2012-12-18 228 views
-2

我试图显示一个错误,当用户从表单提交数据,但没有错误。创建prestashop模块试图在PrestaShop模块上显示错误

尝试把在驱动程序(强迫你告诉我一个错误) 如下

public function postProcess() 
    { 
    $ this-> errors [] = Tools :: DisplayError ('Invalid e-mail address'); 
    } 

,并在模板

{include file = "$ tpl_dir./errors.tpl"} 

<form method="post" action="{$request_uri|escape:'htmlall':'UTF-8'}" class="std" id="form_confirmPassword"> 
<fieldset> 
<p class="text"> 
<label for="email"> {l s = 'E-mail'} </ label> 
<input type = "text" id = "email" name = "email" value = "{if isset ($ smarty.post.email)} {$ smarty.post.email | escape: 'htmlall': 'UTF-8 '| stripslashes} {/ if} "/> 
</ p> 
</ fieldset> 
</ form> 

反正我不能让显示像任何讯息话题错误prestashop本地模块显示...

+0

你确定你用smarty变量赋值你的errors []数组吗? –

回答

1

我做的一切都错了。

从链接调用到不是类或控制器的页面。

我的最后一次通话是......

{base_dir} {$ modules/mymodule/beginprofile.php 

,并在该网页上我都像一个正常的PHP页面的逻辑。

并改变这一点。

{base_dir} {$ index.php? fc = module & MyModule = extrainfos & controller = beginprofile 

我然后将所有功能于扩展Mymodule中的控制器文件夹

内部类FrontController,并曾这样做比这更多的新类。