cake-php@googlegroups.com
[Top] [All Lists]

Re: custom route classes in 2.x?

Subject: Re: custom route classes in 2.x?
From: Sam Sherlock
Date: Tue, 21 Feb 2012 01:57:57 +0000
I have my custom routes working fine in 2.x

App::uses('PageSlugRoute', 'Route');

the class in Lib/Route


App::uses('Article', 'Model');
App::uses('CakeRoute', 'Routing/Route');
class ArticleRoute extends CakeRoute {
...
}

in AppModel.php I have

App::uses('Model', 'Model');

class AppModel extends Model {
...
}
 - S




On 21 February 2012 01:18, lowpass <zijn.digital@xxxxxxxxx> wrote:
I clued in to change it to:

App::uses('PageSlugRoute', 'routes');

But now I get a fatal error when PageSlugRoute imports the Page model:

Fatal error: Class 'Model' not found in
/var/www/vhosts/jcah/app/Model/AppModel.php on line 3

So it's no longer possible to instantiate a model inside a custom
route class? Is anyone doing this in 2.x?

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at http://groups.google.com/group/cake-php
<Prev in Thread] Current Thread [Next in Thread>