I want to insert in Prestashop 1.5
in a tpl
file, a file_get_contents
of a site. It is possible to do directly in a tpl
file, or I insert into a php
file and return the content?
Smarty it is a template engine and of course better to get content in php and then assign it to template:
$smarty->assign('content', file_get_contents('http://google.com/'));
in template
{$content}
but if you really need to do it in template you can:
{assign var='content' value='http://google.com/'}
{$content|file_get_contents}
or just
{'http://google.com/'|file_get_contents}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.