Action doesn't seem to be run after redirect?

Hi there,

I have the following code:

    public function beforeExecuteRoute($dispatcher)
        if (!$this->session->has('user')) {
            if ($dispatcher->getControllerName() == 'login' &&
                ($dispatcher->getActionName() == 'new' || $dispatcher->getActionName() == 'create')
            ) {

When I call

The browser address changes to

The URL is re-written in Nginx

2014/04/16 07:36:15 [notice] 15281#0: *81 rewritten data: "/index.php", args: "_url=/login/new", client:, server: localhost, request: "GET /host_ui/login/new HTTP/1.1", host: ""

However, the action in LoginController isn't hit

     * Handles a new Login
    public function newAction()
        echo "In the Login new action...";

Any ideas why this might be?



OMG - panic over! I'm so embarrased ...

In the createAction in the same controller, I had the following

//        $this->dispatcher->forward(['controller' => 'index']);
        $this->dispatcher->forward(array('controller' => 'index'));

Passing the array literal to forward was causing a PHP parsing error. This is remedied by passing the array function and when the newAction is called, it isn't killed by the PHP parsing error.

I don't actually understand what's wrong with passing the array literal but that's another story!


Pobably because of you php version


Ah, OK. It's 5.4 - I'll look into that possibility :) Cheers.