Apparently this is discouraged for some mysterious reason, but if like me you want to have nice code where models are used from within components (so you don’t have to clutter up your controllers or shell classes), here’s how:
$this->ModelName = ClassRegistry::init('ModelName');
For example, you can place it like this at the start of your component’s definition:
public function __construct() {
$this->Message = ClassRegistry::init('Message');
}





I’ve been looking for this solution for some time. Nailed it.
I thanks you!
[...] Fuente [...]
Thanks a lot! I’m quite a cakePHP-newbe, so those fine details just annoy me. Your solution is awesome! I actually modified it a little bit so I could use the “normal” $uses-Array!
public function __construct() {
foreach($this->uses as $model) {
$this->$model = ClassRegistry::init($model);
}
}