我一直在使用CodeIgniter很长一段时间,但是最近我一直觉得需要转向更先进/更多的OOP框架.Kohana似乎是一个经常被推荐的选项,我的问题是,Kohana与CodeIgniter有何不同?差异列表,特别是语法差异,会很棒.
我正在尝试用这段代码将路由实现到我的bootstrap文件中;
protected function _initRoutes()
{
$router = $this->getResource('frontController')->getRouter();
$router->addRoute(
'profil',
new Zend_Controller_Router_Route
(
'profil/:username',
array
(
'controller' => 'users',
'action' => 'profil'
)
)
);
}
Run Code Online (Sandbox Code Playgroud)
但它不起作用,因为我得到'在一个非对象中调用成员函数getRouter()...'错误.
如何从引导程序中获取控制器?
我已将Zend库文件夹放入我的应用程序的classes文件夹中,并将所有文件和文件夹重命名为小写(使用Ant Renamer).
当我调用Zend_Feed而不是加载/classes/zend/feed.php时,kohana从我的服务器share\ZendFramework\library\Zend\(Zend Server)加载Zend ,所以我收到Cannot redeclare class Zend_Uri_Http错误.
ZF版; 1.10 Kohana版本:GitHub提供的最新文件
我有这两个模型:
class Model_user extends ORM {
protected $_has_many = array('credits', array('model'=>'credit', 'foreign_key'=>'user'));
}
class Model_credit extends ORM {
protected $_belongs_to = array('user', array('model'=>'user', 'foreign_key'=>'user'));
protected $_tb = 'credits';
protected $_pk = 'id';
// method to be implemented
public function total() {
return $total_credits_available;
}
}
// accessing the 'total' method
$user = ORM::factory('user', 1);
$total_credits = $user->credits->total();
问题是如何实现'total'方法,它具有以下特点:
return DB::select(array(DB::expr('SUM(qty * sign)'), 'total'))
->from($this->_tb)
->where('user', '=', $user_id)
->execute()
->total; … 我即将开始建立新的初创公司,所以我需要你的一些指导.
计划网站的最佳方式是什么?我不认为像"先设计,然后数据库关系,然后开始开发",但"如何规划应用程序的工作方式"?
是否有一些经过验证的方法,比如做网站"蓝图"的最佳方法,比如使用某种工具或其他东西?
我需要尽可能多的反馈,因为人们可以给我,这对我来说非常重要.
链接,经验,欢迎一切=)
我想要一些能够绘制过程的工具
页面 - 如果登录 - 执行该操作 - 如果未登录 - 请执行此操作2
我正在尝试创建自己的"模态"窗口,因为PrototypeJS目前不存在这些窗口,这符合我的需求.
问题是观察document.documentElement以更改视口(或document.body,取决于Quirks/Standard模式)的高度和宽度.
kohana ×3
php ×3
kohana-3 ×2
codeigniter ×1
dom ×1
javascript ×1
model ×1
orm ×1
prototypejs ×1