本文整理汇总了PHP中CController::setAction方法的典型用法代码示例。如果您正苦于以下问题:PHP CController::setAction方法的具体用法?PHP CController::setAction怎么用?PHP CController::setAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CController
的用法示例。
在下文中一共展示了CController::setAction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CController
// Migrate up the database
Yii::import('application.commands.shell.ZMigrateCommand');
ZMigrateCommand::AutoMigrate();
Yii::app()->params['installed'] = true;
// Create empty dynamic configuration file
$content = "<" . "?php return ";
$content .= var_export(array(), true);
$content .= "; ?" . ">";
file_put_contents(Yii::app()->params['dynamicConfigFile'], $content);
foreach ($this->getFixtures() as $tableName => $fixturePath) {
$this->resetTable($tableName);
$this->loadFixture($tableName);
}
// initialize a controller (which defaults to null in tests)
$c = new CController('phpunit');
$c->setAction(new CInlineAction($c, 'urltest'));
Yii::app()->setController($c);
// Add Categories
$cGeneral = new ProfileFieldCategory();
$cGeneral->title = "General";
$cGeneral->sort_order = 100;
$cGeneral->visibility = 1;
$cGeneral->is_system = true;
$cGeneral->description = '';
$cGeneral->save();
$cCommunication = new ProfileFieldCategory();
$cCommunication->title = "Communication";
$cCommunication->sort_order = 200;
$cCommunication->visibility = 1;
$cCommunication->is_system = true;
$cCommunication->description = '';