php - View Not Rendered Codeigniter HMVC -


i trying make crud module in codeigniter hmvc seem missing in process. here facing.

i have news module has manage function

function manage(){         $grid = modules::run('crud/rendergrid', 'news' , 'news management');      } 

render grid function

function rendergrid($module , $page_title){          $data['page_title'] = $page_title; //dynamic         $data['module'] = $module;          $data['view_module'] = 'crud';         $data['displayfields'] = modules::run($module.'/get_displayfields');         $data['key'] = modules::run($module.'/get_key');         $data['rows'] = modules::run($module.'/get' , $data['key']);         $data['view_file'] = 'manage';          $this->load->module('dashboard');         $this->dashboard->show_dashboard($data);     } 

here, show_dashboard function loads template layout desired view in it.

function show_dashboard($data = null){         if($data == null){             $data['view_file'] = "manage";             $data['page_title'] = 'sigma web solutions';         }          $this->load->module('templates');         $this->templates->admin($data);     } 

templates->admin

function admin($data){         $this->load->view('admin' , $data);     } 

the view (omitting header n footer)

<?php                 if (!isset($view_file)) {                     $view_file = "";                 }                   if (!isset($view_module)) {                     $module = $this->uri->segment(1);                 }                   if (($view_module!="") && ($view_file!="")) {                      $path = $view_module."/".$view_file;                     $this->load->view($path);                 }                   ?> 

now, when try url news/manage, gives me blank page no source code in it. when try

crud/rendergrid/news/sometitle/ works fine.

kindly point out did miss here. thanks.

working solution:

thanks wolf added route

$route['managenews']= 'crud/rendergrid/news/news';

and works charm. why need route here? shouldn't work. , means every module need have 4 entries in route file crud system work. can suggest better method?


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -