E
E
EVOSandru62014-12-24 03:55:22
Yii
EVOSandru6, 2014-12-24 03:55:22

How to pass a variable through a clip in Yii?

Good afternoon, I muddied the following code in the actionIndex of the SiteController controller :

$this->beginClip('mainPageNews');
            echo '<ul>';
                foreach($news as $item){
                    echo '<li>';
                        echo  CHtml::link($item->NAME,array('news/item/code/'.$item->CODE));
                    echo '</li>';
                }
            echo '</ul>';
        $this->endClip();

Naturally, I take it out in the right place and it works.
<?php if(!empty($this->clips['mainPageContent'])) echo $this->clips['mainPageContent'];?>

I'm wondering if it's possible to pass to an external template, in this case I have column3.php, not the output, but the variable itself, in order to print it already in the view?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Grechushnikov, 2014-12-24
@maxyc_webber

refactoring

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question