There are three ways of specifying the javascript file http://www.symfony-project.org/book/1_2/07-Inside-the-View-Layer
Please see the section 7-26 // In the view.yml indexSuccess: javascripts: [myscript] [php] // In the Action $this->getResponse()->addStylesheet('mystyle1'); $this->getResponse()->addStylesheet('mystyle2'); $this->getResponse()->addJavascript('myscript'); // In the Template <?php use_stylesheet('mystyle1') ?> <?php use_stylesheet('mystyle2') ?> <?php use_javascript('myscript') ?> On 3/14/09, dziobacz <aaabbbcccda...@gmail.com> wrote: > > > also doesn't work :) > > > > > > On 13 Mar, 21:57, Sid Bachtiar <sid.bacht...@gmail.com> wrote: > > Whoops, leave out the .js, for example > > > > javascripts: [registration] > > > > (no .js) > > > > > > > > On Fri, Mar 13, 2009 at 12:07 PM, dziobacz <aaabbbcccda...@gmail.com> > wrote: > > > > > It is strange - Your method is logical but it doesn't work for me :/ I > > > cleared cache. I have also tried to do that for all module > > > 'registration' in yourapp/frontend/config/view.yml: > > > registration: > > > javascripts: [registration.js] > > > but it also didn't work. > > > > > So I will have to use my method. :O > > > > > On 12 Mar, 22:34, Sid Bachtiar <sid.bacht...@gmail.com> wrote: > > >> > In template: > > >> > <?php use_javascript('registration') ?> > > >> > <?php include_javascripts() ?> <------------- this is VERY > > >> > IMPORTANT !!! > > > > >> I think this is unconventional way to do it ... read my other reply on > > >> how to do it in view.yml which is more conventional in Symfony > > > > >> On Fri, Mar 13, 2009 at 10:26 AM, dziobacz <aaabbbcccda...@gmail.com> > wrote: > > > > >> > I know !! :) > > > > >> > In template: > > >> > <?php use_javascript('registration') ?> > > >> > <?php include_javascripts() ?> <------------- this is VERY > > >> > IMPORTANT !!! > > > > >> > On 12 Mar, 19:41, dziobacz <aaabbbcccda...@gmail.com> wrote: > > >> >> I have file 'registration.js' with javascript only for page > > >> >> 'registerSuccess.php' - I added it in template registerSuccess.php: > > >> >> <?php use_javascript('registration.js') ?> > > > > >> >> but it doesn't work - why ? > > > > >> >> If I add this file in layout: > > >> >> <?php use_javascript('jquery.js') ?> > > >> >> <?php use_javascript('skrypty.js') ?> > > >> >> <?php include_javascripts() ?> > > > > >> >> it works but I want this file only for site 'registerSuccess.php'. > > > > >> -- > > >> Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz > > > > -- > > Blue Horn Ltd - System Developmenthttp://bluehorn.co.nz > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---