Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

TutorialController against SignupController


I am trying to make singup form from Tutorial1:

My 'app/views/index/index.phtml' is:


echo "<h1>Hello!</h1>";

echo $this->tag->linkTo("signup", "Sign Up Here!");

Generated HTML is:

<h1>Hello!</h1><a href="/tutorial/signup">Sign Up Here!</a>

When I click "Sign Up Here" URL I get:

Exception: TutorialController handler class cannot be loaded

Why it tries to execute TutorialController when it should be SignupController?

Perhaps you missed this part from the tutorial in your bootstrap file:

$di->set('url', function () {
    $url = new UrlProvider();
    $url->setBaseUri('/tutorial/'); // This is the important part
    return $url;

Without it the router is using the default behaviour, thus thinking that Tutorial is the controller and Signup is the action.

edited Jul '16

I've double checked my bootstrap file. It contains this section and '/tutorial/' as the base URL.

I've tried to rename SignupController to TutorialController. Phalcon asked something about 'signup action'. Why it is thinking that Tutorial is the controller?

I cloned Phalcon from repository and built it manually from source.

Please, anybody help!

Unfortunately it is showstopping problem for me... What else should I do to understand where the problem is?


Got it!...

VirtualHost pointed to subdirectory 'tutorial/public' ))


Glad you solved it by yoruself mate. Good job :)

Now mark your answer as accepted to solve the thread.