I don't think there's any advantage other than those you stated.

On Wednesday, August 3, 2011 11:16:59 AM UTC-4, Richard wrote:

> Is there a advantage to use reponse.file except the length of the code line 
> and the possibility to insert a CSS or JS at the controller level?? 
>
> Is it faster or something?
>
> Thanks
>
> Richard
>
> On Wed, Aug 3, 2011 at 9:03 AM, Anthony <[email protected]> wrote:
>
>>  On Wednesday, August 3, 2011 5:22:18 AM UTC-4, Web2Py Freak wrote: 
>>>
>>> hello guys , 
>>>
>>>  can you show me the way of adding a css file in web2py  i trying to 
>>> add one and its not working   !! help
>>
>>  
>> Assuming you're using the 'welcome' app folder structure, put the file in 
>> /yourapp/static/css, and then link it in the head of your layout view as 
>> follows:
>>  
>> <link href="{{=URL('static', 'css/yourfile.css')}}" rel="stylesheet" 
>> type="text/css" />
>>  
>>  
>> Alternatively, if you're using web2py_ajax.html (which is included in the 
>> layout.html head of the 'welcome' app), anywhere in your code (model, 
>> controller, or view), you can do:
>>  
>> response.files.append(URL('static', 'css/yourfile.css'))
>>  
>>  
>> The web2py_ajax.html code links all the response.files (which can be css 
>> or js files) in your layout.html head.
>>  
>> Anthony
>>
>
>

Reply via email to