// Rename Module->smartyAssign to Module->templateAssign
[+] Front: Add module controller + url dispatch for modules
This commit is contained in:
+17
-2
@@ -515,7 +515,7 @@ abstract class ModuleCore
|
||||
* Return an instance of the specified module
|
||||
*
|
||||
* @param string $moduleName Module name
|
||||
* @return Module instance
|
||||
* @return Module
|
||||
*/
|
||||
public static function getInstanceByName($moduleName)
|
||||
{
|
||||
@@ -1158,6 +1158,21 @@ abstract class ModuleCore
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get realpath of a template of current module (check if template is overriden too)
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @param string $template
|
||||
* @return string
|
||||
*/
|
||||
public function getTemplatePath($template)
|
||||
{
|
||||
$overloaded = $this->_isTemplateOverloaded($template);
|
||||
if (is_null($overloaded))
|
||||
return null;
|
||||
return ($overloaded ? _PS_THEME_DIR_.'modules/'.$this->name : _PS_MODULE_DIR_.$this->name).'/'.$template;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a smarty vars (same syntax as smarty->assign) but prefix all keys with module name
|
||||
*
|
||||
@@ -1165,7 +1180,7 @@ abstract class ModuleCore
|
||||
* @param string $key Variable key (can be an array)
|
||||
* @param mixed $value Variable value
|
||||
*/
|
||||
public function smartyAssign($key, $value = null)
|
||||
public function templateAssign($key, $value = null)
|
||||
{
|
||||
if (is_array($key))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user