本文整理匯總了PHP中DefaultController::indexAction方法的典型用法代碼示例。如果您正苦於以下問題:PHP DefaultController::indexAction方法的具體用法?PHP DefaultController::indexAction怎麽用?PHP DefaultController::indexAction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DefaultController
的用法示例。
在下文中一共展示了DefaultController::indexAction方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testIndexAction
public function testIndexAction()
{
$view = $this->getServiceMockBuilder('FooView')->getMock();
$view->expects($this->once())->method('setTemplate')->with('FooBundle:Default:index.twig')->will($this->returnValue(null));
$view->expects($this->once())->method('handle')->with()->will($this->returnValue('success'));
$controller = new DefaultController($view);
$this->assertEquals('success', $controller->indexAction());
}
示例2: indexAction
public function indexAction($message = NULL)
{
parent::indexAction($message);
$this->view->pick("projects/index");
$this->jquery->exec("\$('[data-toggle=\"tooltip\"]').tooltip()", true);
$this->jquery->getOnClick(".update, .add", "", "#content", array("attr" => "data-ajax"));
$this->jquery->compile($this->view);
}
示例3: testHelloWorld
public function testHelloWorld()
{
/**
* @var \Waddle\Classes\App $app
*/
$app = $this->getMockBuilder('Waddle\\Classes\\App')->disableOriginalConstructor()->getMock();
$controller = new DefaultController($app);
$this->expectOutputRegex('/<h1>Hello, World!<\\/h1>/');
$controller->indexAction('World!');
}
示例4: dispatch
public function dispatch()
{
$flag = false;
if (isset($_GET['ctrl'], $_GET['act'])) {
$ctrlName = "Imie\\Controllers\\" . ucfirst($_GET['ctrl']) . 'Controller';
if (class_exists($ctrlName)) {
$ctrl = new $ctrlName();
$actName = $_GET['act'] . 'Action';
if (method_exists($ctrl, $actName)) {
$ctrl->{$actName}();
$flag = true;
}
}
}
if (!$flag) {
$controller = new DefaultController();
$controller->indexAction();
}
}