Jump to content

Edit History

01generator

01generator

Just bumbed in to this via search. 

Old post I know, but if anyone gets here this might help him/her

I use

class MyModuleModuleFrontController extends ModuleFrontController
{
        /* Conctructor of the controller */
    public function __construct()
    {
        parent::__construct();
    }

    public function initContent()
    {
        parent::initContent();
        // possible variables you want to use in tpl
        $this->context->smarty->assign(
            array(
                'var1' => $var1,
                'var2' => $var2,
            )
        );

        if (version_compare(_PS_VERSION_, '1.7.0.0 ', '<')) {
          	// must be in folder modulename/views/templates/front/
            return $this->setTemplate('front16.tpl');
        } else {
	        // must be in folder modulename/views/templates/front/
            $this->setTemplate('module:MyModule/views/templates/front/front17.tpl');
        }
    }
}

Replace MyModule with your module name, variables, filename etc. 

01generator

01generator

Just bumbed in to this via search. 

Old post I know, but if anyone gets heres this might help him/her

I use

class MyModuleModuleAdminController extends ModuleAdminController
{
        /* Conctructor of the controller */
    public function __construct()
    {
        parent::__construct();
    }

    public function initContent()
    {
        parent::initContent();
        // possible variables you want to use in tpl
        $this->context->smarty->assign(
            array(
                'var1' => $var1,
                'var2' => $var2,
            )
        );

        if (version_compare(_PS_VERSION_, '1.7.0.0 ', '<')) {
          	// must be in folder modulename/views/templates/front/
            return $this->setTemplate('front16.tpl');
        } else {
	        // must be in folder modulename/views/templates/front/
            $this->setTemplate('module:MyModule/views/templates/front/front17.tpl');
        }
    }
}

Replace MyModule with your module name, variables, filename etc. 

01generator

01generator

Just bumbed in to this via search. 

Old post I know, but if anyone gets heres this might help him

I use

class MyModuleModuleAdminController extends ModuleAdminController
{
        /* Conctructor of the controller */
    public function __construct()
    {
        parent::__construct();
    }

    public function initContent()
    {
        parent::initContent();
        // possible variables you want to use in tpl
        $this->context->smarty->assign(
            array(
                'var1' => $var1,
                'var2' => $var2,
            )
        );

        if (version_compare(_PS_VERSION_, '1.7.0.0 ', '<')) {
          	// must be in folder modulename/views/templates/front/
            return $this->setTemplate('front16.tpl');
        } else {
	        // must be in folder modulename/views/templates/front/
            $this->setTemplate('module:MyModule/views/templates/front/front17.tpl');
        }
    }
}

Replace MyModule with your module name, variables, filename etc. 

×
×
  • Create New...