Theming and layout in yii framework(yii 框架中的主题和布局)
问题描述
我是 Yii 框架的新手,正在创建基于模块的 CRM.使用不同的教程,我可以创建自己的主题,但现在我陷入了困境.
I am a newbie in Yii Framework and creating a CRM which is module based. Using different tutorials I am able to create my own theme, but now I am stucked at one point.
在我的主题中,上部 和左侧 在整个应用程序中保持相同,直到用户登录.这就是为什么我把它作为我的 main.php 的一部分,但在登录页面没有按钮显示,只是简单的登录表单,带有 2 文本字段.
In my theme, the upper <nav> and left <nav> remains the same throughout the app, until user is logged in. That's why I made it a part of my main.php, but in the login page there are no buttons to show, just simple login form with 2 textfields.
如何使用自定义主题在我的应用程序中实现此表单?
How can I implement this form in my application using custom themes?
我曾尝试在该特定操作中定义布局,但未成功.任何帮助将不胜感激.
I have tried to define a layout in that particular action but not succeeded. Any help would be appreciated.
推荐答案
为您的视图使用自定义布局是正确的方法.您可以在控制器操作或视图中设置布局.
Using a custom layout for your view is the right way to go. You can either set the layout in the controller action or in the view.
$this->layout = "//layouts/mylayout";
请注意,默认布局 column1.php 和 column2.php 也使用 main.php 布局文件.
Note that the default layouts column1.php and column2.php also use the main.php layout file.
这篇关于yii 框架中的主题和布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:yii 框架中的主题和布局
基础教程推荐
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 如何替换eregi() 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
