Why don't you just use the standard helpers?

i.e. In each of your layouts use the html and javascript helpers to
include the .css and .js files you need, like below:

app/views/layouts/layout_x.ctp
<head>
  ...
  <?php echo $html->css('common_css_file')?>
  <?php $javascript->link('common_js_file', true)?>
  ...
</head>
...

The CSS file must be in app/webroot/css and it must have the .css
extension
The javascript file must be in app/webroot/js and must have the .js
extension

See http://book.cakephp.org/view/206/Inserting-Well-Formatted-elements
for more on the html helper
See http://book.cakephp.org/view/349/Methods for more on the
javascript helper

Warning: the above code was not tested. It is just off the top of my
head.

I have no idea why you are getting the error message you showed. My
guess it that the cause is in your file css_js.ctp. I would look for
some syntax error there.

Hope this helps,
Ken

On Dec 11, 1:22 pm, thomaus <[email protected]> wrote:
> Hi there,
>
> I have to share the same Javascripts and CSSs for various layouts so I
> created an element called "css_js.ctp" and I call it in each layout
> this way :
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

Reply via email to