Tag Archives: variables

How to change pseudo variables to php variables in template files?

Pseudo variables in standard codeigniter template variables: http://www.codeigniter.com/user_guide/libraries/parser.html

This is instructions:

{last_estates}
{/last_estates}

Should be changed to this:

<?php foreach($last_estates as $item): ?>
<?php endforeach(); ?>

And variables inside like:

{thumbnail_url}

Should be changed to:

<?php echo $item['thumbnail_url']; ?>

This for example:

{has_option_36}
{/has_option_36}

to:

<?php if(empty($item['option_36'])): ?>
<?php endif; ?>

To be hanest, I will change all pseudo variables in future to real PHP variables because cause only problems when somebody like you want to customize something, format something differently etc…