确定setTemplateDir()这个方法是否存在。

解决方案 »

  1.   

    $this->context->smarty->assign(Meta::getMetaTags($this->context->language->id, $page_name));
    $this->context>smarty>assign('request_uri',Tools::safeOutput(urldecode($_SERVER['REQUEST_URI'])));
      

  2.   

    上面方法没觉得有问题?不是这样定义samrty的assin?
    $this->context>smarty>assign('变量名','值');$this->context->smarty->assign(Meta::getMetaTags($this->context->language->id, $page_name));
      

  3.   


    if ($this->multishop_context == -1)
    $this->multishop_context = Shop::CONTEXT_ALL | Shop::CONTEXT_GROUP | Shop::CONTEXT_SHOP; $this->bo_theme = ((Validate::isLoadedObject($this->context->employee) && $this->context->employee->bo_theme) ? $this->context->employee->bo_theme : 'default');
    $this->context->smarty->setTemplateDir(array(
    _PS_BO_ALL_THEMES_DIR_.$this->bo_theme.DIRECTORY_SEPARATOR.'template',
    _PS_OVERRIDE_DIR_.'controllers'.DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'templates'
    ));
      

  4.   

    为什么 smarty 变成了null了?
      

  5.   

    $this->context->smarty->setTemplateDir(array(
    _PS_BO_ALL_THEMES_DIR_.$this->bo_theme.DIRECTORY_SEPARATOR.'template',
    _PS_OVERRIDE_DIR_.'controllers'.DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'templates'
    ));这个setTemplateDir方法,哪里有定义?
      

  6.   

    prestashop里用了smarty这个模板引擎,但是这次不知道因为动了什么,$this->context->smarty直接指向null了。
      

  7.   

    你的PHP版本是5.2的吧?换成php5.4的。PHP版本低了。