在Zend视图助手中,有用于根据路由表输出URL的函数url(),例如
$this->url(array('controller' => 'comments', 'action' => 'add')
Run Code Online (Sandbox Code Playgroud)
如何在控制器中执行相同的操作?特别是我想使用控制器/动作语法而不是标准URL来设置Zend表单的动作URL
$form = new Zend_Form;
$form->setMethod('post')->setAction( $this->url(array('controller' => 'comments', 'action' => 'add')) );
Run Code Online (Sandbox Code Playgroud) 如何缓存Doctrine MongoDB结果呢?查看Configuration的代码,它似乎没有像标准Doctrine那样的内置结果缓存,只有查询缓存.
我曾想过在应用程序中创建自己的缓存层,但返回的对象非常繁重,因为它们包含视图不需要的许多Doctrine逻辑.如何配对对象,使它们实际上只是数据容器?