本文整理汇总了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();
}
}