|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
-
-
-
- namespace common\components ;
-
- class MyView extends \yii\web\View
- {
- var $title ;
- var $page_title ;
- var $buttons ;
-
- public function setTitle($title, $page_title = '')
- {
- $this->title = $title ;
- if(strlen($page_title)) {
- $this->page_title = $page_title ;
- }
- else {
- $this->page_title = $title ;
- }
- }
-
- public function getTitle()
- {
- return $this->title ;
- }
-
- public function setPageTitle($page_title)
- {
- $this->page_title = $page_title ;
- }
-
- public function getPageTitle()
- {
- return $this->page_title ;
- }
-
- public function getControllerAction()
- {
- return Yii::$app->controller->id.'/'.Yii::$app->controller->action->id ;
- }
-
- public function addBreadcrumb($breadcrumb)
- {
- $this->params['breadcrumbs'][] = $breadcrumb ;
- }
-
- public function addButton($button)
- {
- $this->buttons[] = $button ;
- }
-
- }
|