开发者

pass parameter from controller to view

开发者 https://www.devze.com 2023-01-23 02:58 出处:网络
I am passing $router->map(\'Owner\', \'Owner/:is_owner\',\'null\', a开发者_StackOverflow中文版rray(\'controller\' => \'companies\', \'action\' => \'index\',\'is_owner\'=>\'1\'));

I am passing

$router->map('Owner', 'Owner/:is_owner','null', a开发者_StackOverflow中文版rray('controller' => 'companies', 'action' => 'index','is_owner'=>'1'));

$router->map('Client', 'Client/:is_owner','null', array('controller' => 'companies', 'action' => 'index','is_owner'=>'0'));

in controller I'm getting it by,

 $flag=$_GET['is_owner'];

in view I want to access $flag...how to do that?


Using smarty you could do it as:

//In controller
$smarty->assign('flag',  $flag);

//In view
{$flag}
0

精彩评论

暂无评论...
验证码 换一张
取 消