tags:

views:

27

answers:

0

this is a handler for building menu

new MenuItem('Owner', lang('Owner'), assemble_url('Owner'), get_image_url('navigation/Company.gif')), new MenuItem('Client', lang('Client'), assemble_url('Client'), get_image_url('navigation/people.gif')),

One system module class in which i've mapped the route

$router->map('Owner', 'Owner','null', array('controller' => 'companies', 'action' => 'index_owner'));
  $router->map('Client', 'Client','null', array('controller' => 'companies', 'action' => 'index_client'));

which calls the controller class in which methods are defined with hte name index_client,index_owner...both method has same code.

function index_client(){
      if(Company::canAdd($this->logged_user)) {
   $this->wireframe->addPageAction(lang('New Company'), assemble_url('people_companies_add_client'));
  } // if 
  if($this->request->isApiCall()) {
    $this->serveData(Companies::findByIds($this->logged_user->visibleCompanyIds()), 'companies');
  } else {
    $page = (integer) $this->request->get('page');
    if($page < 1) {
      $page = 1;
    } // if  

    list($companies, $pagination) = Companies::paginateActive($this->logged_user, $page, 30);

   $this->smarty->assign(array(
     'companies' => $companies,
      'pagination' => $pagination,
    ));
  } // if
} // index   */          

Which inturn calls smarty template named index_owner,index_client. I want that only one template should be called that is "index" because same things are being displayed only one flag in template is checked "is_owner" and according to that display of company is done..please tell me how flow goes like handlers,controller,module,view ??????