emideli Posted May 27, 2017 Share Posted May 27, 2017 i am reading ps dev book, and on the topic of creating frontcontrollers with SEO friendly URL, i am not understanding the purpose of following code {assign var=params value=[ 'module_action' => 'list', 'id_product'=> $smarty.get.id_product ]} why are we creating params array and what is module_action ---- full code <div class="rte"> {assign var=params value=[ 'module_action' => 'list', 'id_product'=> $smarty.get.id_product ]} <a href="{$link->getModuleLink('mymodcomments', 'comments', $params)}"> {l s='See all comments' mod='mymodcomments'} </a> </div> thanks Link to comment Share on other sites More sharing options...
shokinro Posted May 27, 2017 Share Posted May 27, 2017 Below code is used to create (assign) a smarty variable $params so that you can this in code after that, {assign var=params value=[ 'module_action' => 'list', 'id_product'=> $smarty.get.id_product ]} module_action is one of the keys of value of $params so you can access it like $params['module_action'] and the value should 'list' Link to comment Share on other sites More sharing options...
emideli Posted May 27, 2017 Author Share Posted May 27, 2017 thanks, can you point out any tutorial or explain the use of module actions, whey they are used and for what purpose.... Link to comment Share on other sites More sharing options...
shokinro Posted May 27, 2017 Share Posted May 27, 2017 No idea where is your sample code comes from and for what purpose. It seems used to pass a parameters to module hook. You can define and pass any parameters you want. Who knows what the author was trying to do with that sample code. You should find out from the book you are reading? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now