harpreet kaur
harpreet kaur

Reputation: 141

how to include css and js in default.ctp in cakephp

echo $this->Html->meta('icon');

    echo $this->Html->css('cake.generic');
    echo $this->Html->css('style_variation');
    echo $this->Html->css('style');
    echo $this->Html->css('suggest');
    echo $this->Html->css('jquery.lightbox-0.5');
    echo $javascript->link('jquery.js');
    echo $javascript->link('jquery.lightbox-0.5.js');
    echo $javascript->link('suggest.js');

i am using this code but this is not working.

Upvotes: 0

Views: 3265

Answers (1)

Mark
Mark

Reputation: 3389

Include css with

echo $this->Html->css('example');

and javascript with

echo $this->Html->script('example');

Do not write the .js extension when including javascript.

Upvotes: 1

Related Questions