title: where to load javascript in a view page Cakephp
body: <p>i am working on a Cakephp 2.x .. right now i am loading my js and css files like this</p>
  
  <p><strong>View/Layout/default.ctp</strong> </p>
  
  <pre><code>&lt;?php echo $this-&gt;fetch('css'); ?&gt;
  &lt;?php echo $this-&gt;fetch('script'); ?&gt;
  &lt;?php echo $this-&gt;fetch('scriptBottom');?&gt;
  </code></pre>
  
  <p>and in each view file i am doing this because there are some pages i am loading different css and js files </p>
  
  <p>for example
     <strong>View/users/index.ctp</strong></p>
  
  <pre><code> echo $this-&gt;Html-&gt;script('libs/modernizr.custom',array('inline' =&gt; false));
    $this-&gt;Html-&gt;css('reset3860.css', null, array('inline' =&gt; false));
    echo $this-&gt;Html-&gt;script('libs/jquery-1.8.2.min', array('block' =&gt; 'scriptBottom'));
  </code></pre>
  
  <p>now the first problem i am facing right now is when i have to write <strong>js</strong> 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 </p>
  
  <p>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 <strong>css</strong> and <strong>js</strong> files are loaded ..and then i include that file in my default . ctp page</p>