本文整理匯總了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 = '';