another solution:
in app_controller I have
var $css_files = array('site.css', 'lightbox.css'); // these are
the css files I always need
and in app_controller's beforeRender() method I have
$this->set('css_files', $this->css_files);
and in the section of my layout I have
Now I
thanks everyone
On May 12, 10:56 pm, "Nicolás Andrade"
<[EMAIL PROTECTED]> wrote:
> Watch what I did to use different layouts to different specific views:
>
> In app_controller.php :
>
> function beforeRender(){
> if(isset($this->params[Configure::read('Routing.admin')])){
>
Watch what I did to use different layouts to different specific views:
In app_controller.php :
function beforeRender(){
if(isset($this->params[Configure::read('Routing.admin')])){
$this->layout = 'default_admin'; // Uses layout for /admin/
pages
}
if(prop
Put $scripts_for_layout in your (X)HTML head. Then, from any view you
can include JS/CSS by setting the $inline option to false.
$javascript->link('awesome_js_file', false);
and
$html->css('most_awesome_css', null, array(), false);
-Joel.
On May 12, 3:45 pm, MarcS <[EMAIL PROTECTED]> wrote:
I do this by rendering my HTML header with an element, and then passing it
parameters from the controller.
- Original Message
From: MarcS <[EMAIL PROTECTED]>
To: CakePHP
Sent: Monday, May 12, 2008 3:45:23 PM
Subject: include CSS and Javascript into layout 'on demand'
Is it possible to include CSS and Javascript into a layout based on
what the specific view requires?
I would like to use one layout for all my views but there are some
javascript libraries that are onl required for very few actions.
I remember reading that this is possible a while back but I can'