Single Page Controller
Permalink
Hi
I'm doing my first single page controller - quite a noob so bear with me :)
"Call to a member function zxczxczxc() on a non-object"
Files:
\single_pages\indentity_verification\view.php
\controllers\indentity_verification\controller.php
I think I did something wrong or I'm missing something that is used to make a instance of my controller.
I'm doing my first single page controller - quite a noob so bear with me :)
"Call to a member function zxczxczxc() on a non-object"
Files:
\single_pages\indentity_verification\view.php
\controllers\indentity_verification\controller.php
I think I did something wrong or I'm missing something that is used to make a instance of my controller.
On the second part, in the view you will have the the variable $test.
echo $test;
echo $test;
$this->controller->zxczxczxc();
Tried it. Still doesn't work.
I'm pretty sure that my controller isn't loading. Do I need to specify anything in the view about the controller to use or vice versa?
Are my files in the correct folder/nameing structure?
$this->controller->zxczxczxc();
Tried it. Still doesn't work.
I'm pretty sure that my controller isn't loading. Do I need to specify anything in the view about the controller to use or vice versa?
Are my files in the correct folder/nameing structure?
I expect this is what you tried, but just to be sure, what I meant was
If your controller isn't loading, chances are there is an issue with the filename, classname or path not following the naming convention.
If it is not in a package and added by the package controller, you may also need to add it at /dashboard/pages/single/.
Personally, I always build single pages within packages.
echo $this->controller->zxc..etc..();
If your controller isn't loading, chances are there is an issue with the filename, classname or path not following the naming convention.
If it is not in a package and added by the package controller, you may also need to add it at /dashboard/pages/single/.
Personally, I always build single pages within packages.
To check if your controller is loading, put a deliberate syntax error in the php and watch the site crash (or not).
Sorry! Yes that is what I tried.
I added an error and conrete did display a message for it.
Not so sure what you mean by the 'add it at /dashboard/pages/single/' ? This page is going to be used by the public, not dashboard.
I didn't build this in a package but if you think it's a better choice could you maybe link me to a article or example?
I attached the deliberate error and then the one I'm trying to fix :|
I added an error and conrete did display a message for it.
Not so sure what you mean by the 'add it at /dashboard/pages/single/' ? This page is going to be used by the public, not dashboard.
I didn't build this in a package but if you think it's a better choice could you maybe link me to a article or example?
I attached the deliberate error and then the one I'm trying to fix :|
/dashboard/pages/single/ is a dashboard page for managing single pages throughout your site, not just dashboard pages.
Your notes about the commented out lines - beware that it won't be the same instance of the controller as the one that you are working from the view of.