T Thibeault Active member Dec 31, 2015 #1 Hello, I would like parse a content and display it in a template. But, i don't know how to do that with this code : Code: $content .= $template->create('template_name', $params); How to add a view ? Thank's, Thibeault
Hello, I would like parse a content and display it in a template. But, i don't know how to do that with this code : Code: $content .= $template->create('template_name', $params); How to add a view ? Thank's, Thibeault
Jake B. Well-known member Dec 31, 2015 #2 Template hooks are deprecated as of 1.2 iirc. Best to use a template modification
T Thibeault Active member Dec 31, 2015 #3 Jake B. said: Template hooks are deprecated as of 1.2 iirc. Best to use a template modification Click to expand... It's not my question.
Jake B. said: Template hooks are deprecated as of 1.2 iirc. Best to use a template modification Click to expand... It's not my question.
wang Well-known member Dec 31, 2015 #5 Thibeault said: Hello, I would like parse a content and display it in a template. But, i don't know how to do that with this code : Code: $content .= $template->create('template_name', $params); How to add a view ? Thank's, Thibeault Click to expand... Inside your function that will hook into template hooks, you can use something like this. PHP: if($hookName == 'hookName') { $varName = 'code goes here that you want to parse'; $myTemplate = $template->create('template_name', $params); $myTemplate->setParam('varName', $varName); $contents .= $myTemplate; } With this code you create your custom template and you have registered the $varName variable that you can use in your template like this. {$varName}.
Thibeault said: Hello, I would like parse a content and display it in a template. But, i don't know how to do that with this code : Code: $content .= $template->create('template_name', $params); How to add a view ? Thank's, Thibeault Click to expand... Inside your function that will hook into template hooks, you can use something like this. PHP: if($hookName == 'hookName') { $varName = 'code goes here that you want to parse'; $myTemplate = $template->create('template_name', $params); $myTemplate->setParam('varName', $varName); $contents .= $myTemplate; } With this code you create your custom template and you have registered the $varName variable that you can use in your template like this. {$varName}.