我可以在 if 循环中编写表单操作方法吗?在聪明的模板中?
$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'));
它调用控制器,显示添加模板。在控制器中,我传递的参数是“is_owner”。可以再次通过添加模板访问该参数,但是当它重新路由时,它会调用
{form action='?route=people_companies_add' method=post}
{include_template name=_profile_form controller=companies module=system}
我想检查“is_owner”标志并相应地调用所有者或客户端。我可以将表单操作放入 if 循环中吗?就像
if($n==1) 表单 action=?route=peple_com_owner 别的 form action=?route=peple_com_client
它显示 smarty 错误
$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}
{include_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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该有效:
This should work: