title: cakePHP class constructors
body: <p>In normal PHP you can do something like this:</p>
  
  <pre><code>Class Test {
      function __construct($var) {
          echo $var; exit;
      }
  }
  
  new Test('Hello World');
  </code></pre>
  
  <p>So you can pass a variable straight to the constructor. This doesn't seem to work in cakePHP though the variables don't get passed to it. The only way iv managed to do it is do the following:</p>
  
  <p>(component class)</p>
  
  <pre><code>Class TestComponent extends Object {
      function construct($var) {
          echo $var; exit;
      }
  }
  </code></pre>
  
  <p>(controller)</p>
  
  <pre><code>new $this-&gt;Test-&gt;construct('Hello World');
  </code></pre>
  
  <p>Is there a better way of doing this more like the first way without having to call the function name directly?</p>