layout.php is just a wrapper for the the template and contains the 
<head> section of the html, so all things that are added to the head are 
actually added to layout.php by the include_metas() call. so if in 
apps/applicationname/config/view.yml you do:

all:
   javascript:
     - file1
     - file2

Then those javascripts will be added to all the views in the 
application. Likewise if you do that in 
apps/applicationname/modulename/config/view.yml, then it will happen for 
all the action views (templates) in that particular module.

The unless you define an absolute path then the file will be assumed to 
live web/javascript so th definitions above would have 
/javascript/file1.js and /javascript/file2.js as their src attribute. 
But not we are talking about the absolute path on the webserver not in 
the filesystem.

if you need to add something programticaly on the fly like a stylesheet 
or javascript there are helpers for that in addition to manually 
manipulating the sfWebResponse object directly. No matter how you go 
about it though the result is the same - ie. the resource added to the 
head section of the document.

Id read up again if i were you.

Lawrence Krubner wrote:
> 
> 
> On Mar 4, 6:51 am, Paolo Mainardi <[email protected]> wrote:
>> RTFM:http://www.symfony-project.org/book/1_2/07-Inside-the-View-Layer#chap...
> 
> Just to be clear, I'm asking about the layout, not the template. The
> page you point me to shows me how to get my Javascript files into my
> template. But I'm wondering if there is a way to get them into my
> layout.php, without hard-coding the paths.
> 
> 
> 
> 
> 
>>> On Mar 4, 5:50 am, Thomas Rabaix <[email protected]> wrote:
>>>> view.yml
>>>> all:
>>>>   javascript:
>>>>     - file1
>>>>     - file2
>>> Thomas, pardon my ignorance, but how does this work? I put the full
>>> path in view.yml? Like this:
>>> all:
>>>  javascript:
>>>    - /bocahoops/js/jquery/jquery-1.3.1.js
>>>    - /bocahoops/js/jquery/jquery-ui-personalized-1.6rc6.js
>>> But how do I then ensure that these files get included on the page? Do
>>> I call some helper function in the layout?
>> --
>> Paolo Mainardi
>>
>> Vice Presidente Assoc.ILDN (http://www.ildn.net)
>> Blog:http://www.paolomainardi.com
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" 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/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to