Error in controller
Permalink
Hi Guys,
I have created two single pages named Feed (brokerage_feed.php) and Pages (brokerage_search.php) and the respective controllers are
-- for feed => controllers/controller.php
-- for pages => controllers/brokerage_search.php in an add-on.
In the add-on's controller.php i have code as
but the controllers/brokerage_search.php is not working. i have added the below shown code in controllers/brokerage_search.php
the subnav in the controller/brokerage_search.php is not working and i am not able to call or use the functions in controller/brokerage_search.php and in single_pages/dashboard/brokerage_search.php i am displaying a form, on form submission it shows No page found.
Any help would be appreciable
Many thanks
Vijay
I have created two single pages named Feed (brokerage_feed.php) and Pages (brokerage_search.php) and the respective controllers are
-- for feed => controllers/controller.php
-- for pages => controllers/brokerage_search.php in an add-on.
In the add-on's controller.php i have code as
Loader::model('single_page'); $d1 = SinglePage::add('/dashboard/brokerage_feed', $pkg); $d2 = SinglePage::add('/dashboard/brokerage_feed/brokerage_search', $pkg); $d1->update(array('cName'=>'Add-on name', 'cDescription'=>'Add-on description.'));
but the controllers/brokerage_search.php is not working. i have added the below shown code in controllers/brokerage_search.php
Loader::model('brokerage_search', 'brokerage'); class DashboardBrokerageSearchController extends Controller { public $_table = 'brokeragePages'; public $pages = ''; public $pagesDate = ''; public function on_start() { $subnav = array( array(View::url('/dashboard/brokerage_feed'), 'Brokerage Feeds',false), array(View::url('/dashboard/brokerage_feed/brokerage_search'), 'Pages', true) ); $this->set('subnav', $subnav); } public function view() { $html = Loader::helper('html'); $form = Loader::helper('form');
Viewing 15 lines of 18 lines. View entire code block.
the subnav in the controller/brokerage_search.php is not working and i am not able to call or use the functions in controller/brokerage_search.php and in single_pages/dashboard/brokerage_search.php i am displaying a form, on form submission it shows No page found.
Any help would be appreciable
Many thanks
Vijay
I had a similar problem and it ended up being a stupid error of the controller function name not being correct so nothing was being called..
your method needs to be in there and named correctly, it is always best to put something in your on_start(){
print "I was runnin!"
}
or something like that so you can tell it is running.
if you are using $this->action('search');
you need a search() method in your controller
I always waste at least 20 minutes getting these things all working, I seem to have a mental block against it lol
print "I was runnin!"
}
or something like that so you can tell it is running.
if you are using $this->action('search');
you need a search() method in your controller
I always waste at least 20 minutes getting these things all working, I seem to have a mental block against it lol