Url Problems

Hello everyone!

I’ve followed this wiki post.

In front end I have menu with the link to back end.




<?php $this->widget('zii.widgets.CMenu',array(

                'items'=>array(

                    array('label'=>'Home', 'url'=>array('/site/index')),

                    

                    array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')),

                    array('label'=>'Contact', 'url'=>array('/site/contact')),

                    array('label'=>'Backend','url'=>'backend.php','visible'=>Yii::app()->user->checkAccess('admin')),

                ),

      )); ?>



And in main.php in /protected/config I have configuration like this:




'urlManager'=>array(

			'urlFormat'=>'path',

                        'showScriptName'=>false,

			'rules'=>array(

				'<controller:\w+>/<id:\d+>'=>'<controller>/view',

				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',

				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

			),

		),



But when clicking on Back end from main menu I’ve got this error:





Error 404

The system is unable to find the requested action "backend.php".




That’s all. Hope you can help me!

Thank you for reading

Regards

Hung

Hi Trinh Duy Hung

First of all,

why you are trying to call php directly rather than Yii controller/action ?

You could make a module for all admin actions

but if you have a very specific reason for that you could use

array(‘label’=>‘my label’,‘url’=>‘http://www.yourdomain.com/backend.php’),