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.

Controller-View not working

Im following the beginner tutorial 1 at http://docs.phalconphp.com/en/latest/reference/tutorial.html#designing-a-sign-up-form But when I go to view the signup form, it says "Object not found!". However the previous tutorial with the "Hello! sign up here" page is working fine for me. I wonder what have I missed?



2.9k

Yes, and I am sure that the structure of the files and folders are correct too...



2.9k

Update: I just now downloaded the full example code identical to the tutorial examples, and I got the same "Object not found!" error when I click the Signup link from the index page.

Could someone please tell me why this is happening? I have tried this on [email protected], and a LAMP setup on Ubuntu. I still get the object not found after I click the signup link.



84.5k
Accepted
answer

Check that your baseUri is properly configured according to your set up:

//Setup a base URI so that all generated URIs include the "tutorial" folder
$di->set('url', function(){
        $url = new \Phalcon\Mvc\Url();
        $url->setBaseUri('/tutorial/');
        return $url;
});

http://docs.phalconphp.com/en/latest/reference/tutorial.html#bootstrap



2.9k
edited Aug '14

Thanks, well at the htdocs root I have the "tutorial" folder holding the "app" and "public" folders inside, and the baseUri was exactly '/tutorial/'.

EDIT: I just found a strange thing: both http://localhost/tutorial/signup and http://localhost/tutorial/index can be loaded correctly if I type that in to the address bar. But on the index page's signup link, it is linking to http://localhost/public/signup Why is that?

EDIT2: I thought the tutorial included the baseUri setup in the index.php, that was the piece that I was missing with the tutorial example code downloaded from github.