i am working on a Cakephp 2.x .. right now i am loading my js and css files like this
View/Layout/default.ctp
<?php echo $this->fetch('css'); ?> <?php echo $this->fetch('script'); ?> <?php echo $this->fetch('scriptBottom');?> and in each view file i am doing this because there are some pages i am loading different css and js files
for example View/users/index.ctp
echo $this->Html->script('libs/modernizr.custom',array('inline' => false)); $this->Html->css('reset3860.css', null, array('inline' => false)); echo $this->Html->script('libs/jquery-1.8.2.min', array('block' => 'scriptBottom')); now the first problem i am facing right now is when i have to write js at the bottom of view page for example if i am submitting a form through ajax .. i can't write at the bottom of the index page ... because if i write there the js will go at the middle or center of the page so now what i do is i go the default.ctp and write there.. so i want to write at the bottom of the index page so it can easily managable and i can see it well what i am doing
the second question is what is the best way to manage all this ... or is there a way that i can make one file of cs and js ... in which there is only the css and js files are loaded ..and then i include that file in my default . ctp page