Hi there
When I browse to my ContentDetailController’s index action /contentdetail/ OR /contentDetail/ with caseSensitive set to false it doesn’t show my contentdetail.php layout file. Sometimes it loads the /views/contentDetail/index.php. When I remove the caseSensitive config setting from the main.php file, I can access the layout correctly through /contentDetail/. Is setting the caseSensitive config property the correct way to go about routing with case in Controller class names , like I have with ContentDetailController? I also tested with a controller name of DetailController.php, which worked perfectly when I accessed its actions like /detail/test.
I know I can set ruls for urlManager in the config file, but I really want some clarity on my issue.
I have the following setup:
-
Operating System: Ubuntu 11.04 running in VirtualBox
-
Web Server: Apache 2
-
Browser Type: Firefox
-
Version 1.1.9 January 1, 2012
/controllers/ContentDetailController.php
/views/contentDetail.index.php
/views/layouts/contentdetail.php
ContentDetailController.php
<?php
class ContentDetailController extends BaseController
{
public $layout = '//layouts/contentdetail';
public function actionIndex()
{
$this->render('index');
}
}
}
?>
config/main.php
'caseSensitive' => false,
/layouts/contentdetail.php
<?php $this->beginContent('//layouts/main'); ?>
<div class="container_12">
</div>
<?php $this->endContent(); ?>
My Application Log output
10:20:48.186086 error exception.CHttpException.404
exception 'CHttpException' with message 'Unable to resolve the request
"contentdetail".' in
/var/www/tracc/yii/framework/web/CWebApplication.php:280
Stack trace:
#0 /var/www/tracc/yii/framework/web/CWebApplication.php(135):
CWebApplication->runController('contentdetail')
#1 /var/www/tracc/yii/framework/base/CApplication.php(162):
CWebApplication->processRequest()
#2 /var/www/tracc/wgll/frontend/www/index.php(34): CApplication->run()
#3 {main}
REQUEST_URI=/contentdetail
---