php - WP functions style in codeIgniter -


where should put function loads model , display view not accessible url. mean, need write function should call view , function displays menu list.

function displaymenu () {    $menu = $this->model->getmenuresults();    $this->load->view( 'viewresults', $menu); } 

should write private function in main controller?

you can use private functions in codeigniter controller

private function _displaymenu() {   $menu = $this->model->getmenuresults();   $this->load->view( 'viewresults', $menu); } 

straight documentation

private functions

in cases may want functions hidden public access. make function private, add underscore name prefix , not served via url request. example, if have function this:

private function _utility() {   // code } 

trying access via url, this, not work:

example.com/index.php/blog/_utility/ 

for more details go http://ellislab.com/codeigniter/user-guide/general/controllers.html#private


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -