Jump to content

module values are not assigned to smarty template


prestashop_newuser

Recommended Posts

Hi,

I am doing a small module. In that I am fetching some data from the database in hook. The code for hook is like this, in this I just want to assign the value of 

  


public function hookHome($params) {
    $defaultLanguage = (int)(Configuration::get('PS_LANG_DEFAULT'));
    global $cookie, $smarty;
    $value=array();
    $sql_select="SELECT * FROM "._DB_PREFIX_."storeinfo WHERE status = '1'";
    $value=Db::getInstance()->ExecuteS($sql_select);
   // print_r($value);
    


    $smarty->assign('array',$value);
    $smarty->assign('default',$defaultLanguage);
    return $this->display(__FILE__, 'storeinfo.tpl');
  }

  

  In view file 

(storeinfo.tpl)

 I want to show the values thats why I just made

  

{$array|@print_r}

 in storeinfo.tpl but it did not showed anything. Now If I am doing print_r($value) in the public function hookHome($params) {} I am getting the array. But the assigned values in smarty is not showing in .tpl file so can someone kindly tell me what is the problem here..Any help and suggestions will be really appreciable. Thanks

 

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...