2016-06-22, 19:17:19
(2016-06-14, 05:22:09)Tyblitz Wrote: Eg if you had the following:
In your extended component you could do:PHP Code:<?php get_ext_component($slug, array(
'greet' => 'Hello',
'name' => 'world'
)); ?>
PHP Code:<?php echo $params->greet . ' ' . $params->name . '!'; ?>
And it would output: 'Hello world!'.
That's really funny, because all this is easy to achieve with ItemManager, in just 2 lines, even without use exec():
Code:
$sidebarContent = imanager()->getItem('name=components', 'slug=sidebar_inc')->fields->content->value;
echo imanager()->getTemplateEngine()->render($sidebarContent, array('first_name' => 'Dieter', 'last_name' => 'Bohlen'));
The output might look like this:
Code:
<div class='sidebar'>
<h3>This is my Sidebar:</h3>
<p>My Name is: Dieter Bohlen</p>
</div>
No offence-but has your effort really paid off? ;-)