Note that there are some explanatory texts on larger screens.

plurals
  1. POPhalconphp routes not working
    primarykey
    data
    text
    <p>I'm new to phalconphp and following their tutorials, as far as I understand it, I don't need to create a specific routing component and that it should pick up a route if it exists. I could obviously be massively wrong here which means it should be easy to correct me! But so far the only controller that will work is my indexController.</p> <p>This is my bootstrap</p> <pre><code>&lt;?php try { //Register an autoloader $loader = new \Phalcon\Loader(); $loader-&gt;registerDirs(array( '../app/controllers/', '../app/models/' ))-&gt;register(); //Create a DI $di = new Phalcon\DI\FactoryDefault(); //Setting up the view component $di-&gt;set('view', function(){ $view = new \Phalcon\Mvc\View(); $view-&gt;setViewsDir('../app/views/'); return $view; }); //Handle the request $application = new \Phalcon\Mvc\Application($di); echo $application-&gt;handle()-&gt;getContent(); } catch(\Phalcon\Exception $e) { echo "PhalconException: ", $e-&gt;getMessage(); } </code></pre> <p>And then if I create my own FooController</p> <pre><code>&lt;?php class FooController extends \Phalcon\Mvc\Controller { public function indexAction() { echo "FOO"; } public function fooAction(){ echo "FOO"; } } </code></pre> <p>Neither of these actions will ever get fired. Now I actually receive a 404 error document from the server. So I'm not sure if there's an issue with my .htaccess file, again though this is copied straight from the tutorial</p> <pre><code>&lt;IfModule mod_rewrite.c&gt; RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L] &lt;/IfModule&gt; </code></pre> <p>Can anyone see anything obviously wrong here? The only difference is I've set up a view for the indexController. I think it's the 404 which is leading me to believe it's more an issue with the server set-up perhaps then my php code</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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