title: sending from controller countries to other another index file for projects
body: <p>I am new in cakephp and using old version cakephp 1.2
  I have a controller &quot;countries_controller.php&quot;</p>
  <pre><code>&lt;?php
  class CountriesController extends AppController{
      var $countryname = 'Countries';
  
      public function index(){
          $tibetested = $this-&gt;set('countries', $this-&gt;Country-&gt;findAll());
      }
  
      function view($id = null)
      {
          $this-&gt;Country-&gt;id = $id;
          $countryname=$this-&gt;set('country', $this-&gt;Country-&gt;read());
          //$this-&gt;layout='projects/view.thtml';
      }
  }
  </code></pre>
  <p><strong>and this if the index for countries controller</strong></p>
  <pre><code>&lt;?php?&gt;
  &lt;h1&gt;List of Countries, total of &lt;!--how to get a count for all rows --&gt;&lt;/h1&gt;
  &lt;table&gt;
      &lt;tr&gt;
          &lt;th&gt;Id&lt;/th&gt;
          &lt;th&gt;Country name&lt;/th&gt;
          &lt;th&gt;Country Units&lt;/th&gt;
          &lt;th&gt;Package price&lt;/th&gt;
      &lt;/tr&gt;
      &lt;?php foreach ($countries as $country){ ?&gt;
      &lt;tr&gt;
          &lt;td style=&quot;width: 30%&quot;&gt;&lt;?php echo $country['Country']['id']; ?&gt;&lt;/td&gt;
          &lt;td style=&quot;width: 30%&quot;&gt;
              &lt;?php echo $html-&gt;link($country['Country']['country_name'], $this-&gt;webroot.'projects/index/'.$country['Country']['id']=$project['Project']['Country_id']); ?&gt;
          &lt;/td&gt;
          &lt;td style=&quot;width: 30%&quot;&gt;&lt;?php echo $country['Country']['country_unit']; ?&gt;&lt;/td&gt;
          &lt;td style=&quot;width: 30%&quot;&gt;
              &lt;?php echo $country['Country']['country_price']; ?&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;?php 
      } 
      ?&gt;
  &lt;/table&gt;
  </code></pre>
  <p><strong>for the projects i have also an controller under name &quot;projects_controller.php</strong></p>
  <pre><code>&lt;?php
  class ProjectsController extends AppController{
      var $projectname = 'Projects';
  
      public function index(){
           $this-&gt;set('projects', $this-&gt;Project-&gt;findAll());
      }
  
      public function view($id=null){
          $this-&gt;Project-&gt;id=$id;
          $this-&gt;set('project', $this-&gt;Project-&gt;read());
      }
  }
  ?&gt;
  </code></pre>
  <p><strong>and the index file for the project is</strong></p>
  <pre><code>&lt;?php
  
  ?&gt;
  &lt;h1&gt;Projects belongs to &lt;!-- I need to get country name here--&gt; &lt;/h1&gt;
  &lt;table&gt;
      &lt;tr&gt;
          &lt;th&gt;Project Name&lt;/th&gt;
          &lt;th&gt;Project Price&lt;/th&gt;
          &lt;th&gt;Project Deductions&lt;/th&gt;
      &lt;/tr&gt;
  
      &lt;?php foreach ($projects as $project){ ?&gt;
      &lt;tr&gt;
          &lt;td style=&quot;width: 30%&quot;&gt;&lt;?php echo $project['Project']['project_name']; ?&gt;&lt;/td&gt;
          &lt;td style=&quot;width: 30%&quot;&gt;&lt;?php echo $project['Project']['project_price']; ?&gt;&lt;/td&gt;
          &lt;td style=&quot;width: 30%&quot;&gt;&lt;?php echo $project['Project']['project_deduction']; ?&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;?php 
      } 
      ?&gt;
  
  &lt;/table&gt;
  
  &lt;?php 
      echo $html-&gt;link('Home ', $this-&gt;webroot.'countries/index/');
  ?&gt;
  </code></pre>
  <p>My question is how can i get the country name based on which i click it from index controller pass it to index projects?</p>
  <p>Also how can i get the numbers of countries in index countries?</p>
  <p>by the way this code is using cakephp 1.2</p>