-
Notifications
You must be signed in to change notification settings - Fork 5
Module Layout
Yee Siang edited this page Jan 8, 2020
·
4 revisions
You can define which layout to use in OpenHub's module controller in one of the following methods:
public $layout = 'backend';
Or
public function init()
{
parent::init();
$this->layout = 'backend';
....
}
-
layouts.backend
- using the layout namedbackend
found in application layout directory (be it default or overridden) -
backend
- using the layout namedbackend
found in layout directory inside module -
application.views.layouts.backend
- explicitly using the layout namebackend
in from the default application layout directory (Note: this is dangerous, as it will bypass the layout override and caused inconsistency)
In protected/modules/boilerplateStart/views/layouts/backend.php
:
<?php Yii::app()->getClientScript()->registerCssFile($this->module->getAssetsUrl() . '/css/backend.css'); ?>
<?php Yii::app()->getClientScript()->registerScriptFile($this->module->getAssetsUrl() . '/javascript/backend.js', CClientScript::POS_END); ?>
<?php $this->beginContent('layouts.backend'); ?>
<?php echo $content; ?>
<?php $this->endContent(); ?>
Notice the use of layouts.backend
, it will automatically using the backend layout view file from application layout directory, be it the default or overridden.
-
- Coding Standard
- Naming Convention
- The Core Architecture
- Configuration
- Database
- Extending Model with Meta
- Components
- Layouts & Views System
- UI Components
- Common Building Block
- Master Data
- Default Features
- Default Modules
- Cron
- Notify
- Neo4J Database
- Multi Domains
- Multilingual (i18n)
- DevOps
- Open Source Project Webpage
- Access Control Limit
- Migration
-
Others