I’m trying to expand upon Larry Ullman’s introductory tutorial on Yii where you create an employee MVC and department MVC. I want to add a “tab” to the skeleton webapp created by yiic, which I have successfully done by adding the following line:
array(‘label’ => ‘Company Info’, ‘url’ =>array(’/site/companyInfo/’,))
To the Cmenu widgit in the /protected/views/layouts/main.php file, and the site displays my tab with its label "Company Info" upon loading.
When i try and click on my tab I get:
The system is unable to find the requested action "companyInfo".
my companyInfo.php file looks like such and is stored in: /protected/views/site :
$this->pageTitle=Yii::app()->name . 'Company Info'; $this->breadcrumbs=array('Company Info',);
<?php $this->widget('zii.widgets.CMenu',array( 'items'=>array( array('label' => 'Employees', 'url'= >array('/employee/')), <--- syntax error after 'url'= array('label'=>'Department', 'url'=>array('/department/')), ), ) ); ?>
When I paste the above code contained in my file into the "about.php" file in /sites/about.php it works…
so what gives? do I need to create a controller for my file companyInfo? or do I need to update something in the SiteController.php file to get this guy to render? I am completely stymied and would really appreciate some help.