Hi, I'm the last stupid newbie coming to illumination. I just started
using CakePHP on my WebSite (http://www.moonbiter.net), and was easy to
build the blog, guestbook and a few other things but now I don't know
how implement a theme mechanism.

I know that AppController have the layout variable I can use to include
a different... layout but I wanna also use different CSS that are
loaded in many different views, i.e. this is the index of the news
section:

<?php
        echo $page->render_menu($menu);
        echo $page->before_content(null,$logged,$errors,$notices);

        echo $page->include_css('news');
?>
<?php echo
        $this->renderElement('news', array("news" => $news));
?>

so a news-specific css is loaded only for news related pages, there're
others for guestbook, blog and so on. I'm using an helper called Page
that do a few things, one of them is including css files:

        function include_css($name)
        {
                $output = '<link
href="'.$this->webroot.'themes/techmoon/css/'.$name.'.css"
rel="stylesheet" type="text/css" >';
                return $this->output($output);
        }

now I wanna continue using this method "include_css" and just change
the first line in this way:

$output = '<link
href="'.$this->webroot.'themes/'$this->theme.'/css/'.$name.'.css"
rel="stylesheet" type="text/css" >';

my problem it's that I don't know a way to send informations to the
helper. I set the theme in my controller but I can't retrieve a
controller reference in my little helper object... any suggestions?

Thanks in advance,

Federico, the stupid newbie


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to