Jump to content

[SOLVED] Module validator category tree


spinelle

Recommended Posts

Hello,

 

I try to valide a module in PrestaShop Validator, but I have an error. I want to use a categories tree so I use something like this in php:

 

for >= 1.6.0:

$helper = new HelperTreeCategories('categories-treeview');

$category_tree = $helper->render();

 

for < 1.6.0:

$helper = new Helper();
$category_tree = $helper->renderCategoryTree();

 

 

and this in my template:

{$category_tree}

 

The category_tree variable is HTML.

 

 

The error in the validator is:

"Variable should be escaped, modifier not found ('htmlall', 'intval', etc.)."

 

What should I do?

 

Thanks

Link to comment
Share on other sites

Thank you for your help.

 

The code with the variable is like this:

<div id="categories">
     <p>{l s='Categories' mod='modulename'}</p>
      {$category_tree}
</div>

 

The variable content the tree category. I got it with this:

for >= 1.6.0:

$helper = new HelperTreeCategories('categories-treeview');

$category_tree = $helper->render();

 

for < 1.6.0:

$helper = new Helper();
$category_tree = $helper->renderCategoryTree();

 

If I use "{$category_tree|escape:'html':'UTF-8'}" there is no category tree anymore but the HTML code in text.

 

I join pictures of the two exemples (with and without escape)

 

I hope this will be more understandable. (And I apologize for my english)

post-712624-0-55005700-1407956926_thumb.jpg

post-712624-0-07315100-1407956936_thumb.jpg

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...