Код: Выделить всё
class NestedSet extends CActiveRecord
{
public static function model($className=__CLASS__)
{
return parent::model($className);
}
public function tableName()
{
return 'cat'; // таблица категорий
}
public function hello()
{
return 'hello from model!';
}
}
Код: Выделить всё
class AdminController extends CController
{
public function actionIndex()
{
echo 'Hello world!';
NestedSet::model()->findAll();
$this->render('main');
}
}
Код: Выделить всё
$NestedSet = new NestedSet();
Что делаю не так? Кстати для чего $this->loadModel(); ?Internal Server Error
include(NestedSet.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory
An internal error occurred while the Web server was processing your request. Please contact the webmaster to report this problem.
Thank you.
И для чего этот обязательный код?
Код: Выделить всё
public static function model($className=__CLASS__)
{
return parent::model($className);
}