SEE LAST COMMENT PLS
i try to put each actions in a different file but i get the file not found error.
Filestructure:
private_html --application ----controller ------index --------IndexAction.php ------IndexController.php --framework public_html -- index.php
index.php
<?php // change the following paths if necessary $yii='/home/bas/projects/yii.dev/private_html/framework/yii.php'; $config='../private_html/application/config/main.php'; // remove the following line when in production mode defined('YII_DEBUG') or define('YII_DEBUG',true); require_once($yii); Yii::createWebApplication($config)->run();
IndexController .php
<?php class IndexController extends CController { /** * Declares class-based actions. */ public function actions() { return array( 'index' => 'application.controllers.index.IndexAction', ); } }
Error:
PHP Error Description YiiBase::include(IndexAction.php) [<a href='yiibase.include'>yiibase.include</a>]: failed to open stream: No such file or directory Source File /home/bas/projects/yii.dev/private_html/framework/YiiBase.php(297)
when i use 'index' => Yii::app()->basePath . '/controllers/index/IndexAction.php' I get Alias "/home/bas/projects/yii.dev/private_html/application/controllers/index/IndexAction.php" is invalid. Make sure it points to an existing directory or file. and when i check the path, the file is there…