2008年8月21日星期四

[fw-mvc] question about view script

Hello everyone.

In my view scripts i do

<?php echo $this->render('header.phtml'); ?>
<?php echo $this->render('menu.phtml'); ?>
then page specifics
<?php echo $this->render('footer.phtml'); ?>


Now in my header.phtml i have something like:

    <?php if ($this->script){?>
        <script type="text/javascript" src="http://www.site.com/js/.<?$this->script?>."></script>
    <?php } ?>

But when i say in my controller:

$this->script = "event.js";

then it doesn't work.

My question is: how can I set the variable $this->script in my header template from within my controller?

Thanks in advance,


J.Sanders

没有评论: