CakePHP – Components
Naming:
- MathComponent
- extends Object
- /app/controllers/components/math.php
Initialising:
var $components = array(‘Math’, ‘Session’);
When including Components in a Controller you can also declare a set of parameters that will be passed on to the Component’s initialize() method. These parameters can then be handled by the Component.
var $components = array(
‘Math’ => array(
‘precision’ => 2,
‘randomGenerator’ => ’srand’
),
‘Session’, ‘Auth’
);
