Have a look at AssetMapper helper I have found it to be view useful

scripts can be tied to controllers or actions

I use a main set of scripts for my public site and others for admin,  I
initialize the scripts in different ways depending on the current controller
/ action pair  (AssetMapper does this nice and tidys [also compresses script
& css])

I may set up a cfgArray and set it in the controller passing it to the view
and then

e($javascript->codeBlock($javascript->object($cssArr)));
e($javascript->link($scriptsArray));

thats without using the assetmapper helper; with it you'll have one css file
and one script file

On 04/02/2008, bob <[EMAIL PROTECTED]> wrote:
>
> But the problem is that I use a default layout (in
> view/layout/default.ctp), where i define the <head>, <title>, javascript,
> css declarations. But now, I just want to add a javascript or css for just a
> particular view, not all the views (in which case, i can just use
> $javascript->link() and html->css() in the view/layout/default.ctp). how
> would i do this without having to use another layout?
>
> On Feb 4, 2008 2:29 PM, Joel <[EMAIL PROTECTED]> wrote:
>
> >
> > Thanks, my bad.
> >
> > Sam Sherlock wrote:
> > > $html->css for stylesheets
> > >
> > > On 04/02/2008, Joel <[EMAIL PROTECTED]> wrote:
> > > >
> > > >
> > > > Use the $javascript->link() and $css->link() helpers, respectively.
> > > >
> > > > bob wrote:
> > > > > similarly, for css files?
> > > > >
> > > > > On Feb 4, 2008 12:37 PM, bob <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > > i have a javascript .js file that i want to add to just one of
> > my
> > > > views,
> > > > > > (not in the default layout). how do i do this? thanks
> > > > > >
> > > > >
> > > > > >
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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