组件没有setTemplate()!我知道,但也许有另一种方法可以做到这一点?
(问题似乎是关于php框架:http://www.symfony-project.org/)
Jer*_*man 10
sfComponents上没有setTemplate方法.你基本上有3个选择:
executeFoo(),你想要渲染_bar.php模板的方法,只需include_partial('bar', $vars)在里面调用_foo.php.组件不处理模板,您只能使用partials.如果需要从组件类中返回特定的部分,可以执行以下操作:
return get_partial('module/action', array('paramName' => $paramValue));
Run Code Online (Sandbox Code Playgroud)
为了解决这个问题,我正在做:
echo get_component('module', 'action', $this->getVarHolder()->getAll());
return sfView::NONE;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6767 次 |
| 最近记录: |