I have 1.1.13 Yii
<?php
class CompanyController extends Controller {
protected function beforeAction(CAction $action) {
$current_menu = Yii::app()->controller->getId();
$base_url = Yii::app()->request->baseUrl;
$menus = Menus::getMainMenu();
$sub_menus = array();
foreach($menus as $menu_content) {
if(stripos($menu_content['url'][0], $current_menu)) {
$sub_menus = $menu_content['items'];
}
}
$this->render($action->id, array(
'menus' => $menus,
'sub_menus' => $sub_menus,
'base_url' => $base_url,
'action' => $action->id,
'current_menu' => $current_menu
));
}
public function actionOverview() {
// nothing to do
}
public function actionManagement() {
}
public function actionIndex() {
}
public function actions() {
$a = 1;
return array(
'board-of-directors' => 'application.controller.company.BoardOfDirectors',
);
}
public function missingAction($action) {
$b = 1;
}
}
This is my company controller. Also I have action, which has dashes in name (board-of-directors). That is why I want to realize action() method to invoke another action method to this action, but I receive error, which is in view file. so actions() do not call.
Also the another strange thing is that beforeAction() do not call, until I do not realize empty action method, like I already have (e.g actionManagement()). Help me guys to understand this strange behavior. Thanks in advance.