can i write form action method in if loop? in smarty template?
$router->map('people_companies_add_owner', 'people/add/:is_owner','null', array('controller' => 'companies', 'action' => 'add','is_owner'=>'1'));
$router->map('people_companies_add_client', 'people/add/:is_owner','null', array('controller' => 'companies', 'action' => 'add','is_owner'=>'0'));
which calls controller, showing add template. in controller I m getting parameter passed tht is "is_owner".which can again be accessible by add template but when it is rerouted it calls,
{form action='?route=people_companies_add' method=post}
{includ开发者_JAVA百科e_template name=_profile_form controller=companies module=system}
I want to check the "is_owner" flag and accordingly call owner or client.can I put form action in if loop?? like
if($n==1) form action=?route=peple_com_owner else form action=?route=peple_com_client
It is showing smarty error
This should work:
<form
method="post"
action="?route={if $is_owner}people_com_owner{else}people_com_client{/if}"
>
精彩评论