Note that there are some explanatory texts on larger screens.

plurals
  1. POPhalcon dispatching execute two actions instead of one
    text
    copied!<p>i will try to explain my problem.</p> <p>When dispatcher call dispatch method it execute two controller actions instead of one. First it execute correct action and after this it always execute defined notFound action. No output from notFound action is render. I found this then i put some database logging logic in my notFound action. With every request new records appear in my db table which is not expexted.</p> <p>My code looks like this:</p> <pre><code>$d = new Dispatcher(); $d-&gt;setDI($di); $d-&gt;setControllerName($router-&gt;getControllerName()); $d-&gt;setActionName($router-&gt;getActionName()); $d-&gt;setParams($router-&gt;getParams()); $d-&gt;dispatch(); </code></pre> <p>Then i saw a problem here i tried to debug a lit with this code, but it goes right way, everything works fine:</p> <pre><code>$d = new Dispatcher(); $d-&gt;setDI($di); $d-&gt;setControllerName("login"); $d-&gt;setActionName("index"); $d-&gt;setParams(array()); $d-&gt;dispatch(); </code></pre> <p>So i try to do it this way, but this don't work:</p> <pre><code>$controller = $router-&gt;getControllerName(); $action = $router-&gt;getActionName(); $params = $router-&gt;getParams(); $d = new Dispatcher(); $d-&gt;setDI($di); $d-&gt;setControllerName($controller); $d-&gt;setActionName($action); $d-&gt;setParams($params); $d-&gt;dispatch(); </code></pre> <p>Then i decide that router is the bad guy here and try this and expecting bad results:</p> <pre><code>$controller = $router-&gt;getControllerName(); $action = $router-&gt;getActionName(); $params = $router-&gt;getParams(); $d = new Dispatcher(); $d-&gt;setDI($di); $d-&gt;setControllerName("login"); $d-&gt;setActionName("index"); $d-&gt;setParams(array()); $d-&gt;dispatch(); </code></pre> <p>But everithing works fine. Please tell me what's going on and what am i doing wrong. Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload