开发者

how to share pariail templates in different modules

for example, I hava a partial template named _header.php, I want to use it in both Post, Forum module, How can i write 开发者_如何学CrenderPartial(), to load this template.


placed your partial view to app layouts dir.

<?php
 $this->renderPartial('//_header.php');
?>

absolute view within a module: the view name starts with a single slash '/'. In this case, the view will be searched for under the currently active module's view path. If there is no active module, the view will be searched for under the application's view path.

absolute view within the application: the view name starts with double slashes '//'. In this case, the view will be searched for under the application's view path. This syntax has been available since version 1.1.3.

reference getViewFile()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜