0

I am new to Smarty code and was just wondering if you can provide me with PHP equivalent to this piece of smart code..

    <div class = "span3">
        <a href = "{$auction->get('links.details')}"><div id="raffle-list-img">
        {if $current_item->get('imagecount')}
    {$current_item->get('gallery')}
{/if}
</div></a>
    </div> 

This was in a .tpl file and I need it placing in a .php file.

Im trying to make an auction item to show a photo.

Thank you for your help.

2 Answers 2

1

Smarty is very close to standard PHP, so you can normally do an almost direct conversion between the two:

<div class="span3">
    <a href="<?php $auction->get('links.details') ?>">
        <div id="raffle-list-img">
        <?php
            if( $current_item->get('imagecount') ) {
                echo $current_item->get('gallery');
            }
        ?>
        </div>
    </a>
</div>

I reformatted/reindented to make it more readable.

Sign up to request clarification or add additional context in comments.

Comments

0

well actually it won't be much more readable but I believe it will look like that : <div class = "span3"> <a href = "<?php $auction->get('links.details'); ?>"><div id="raffle-list-img"> <?php if ($current_item->get('imagecount')) { $current_item->get('gallery'); } ?> </div></a> </div>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.