What are the possible reasons for App::import() not working?
Posted
by Julien Poulin
on Stack Overflow
See other posts from Stack Overflow
or by Julien Poulin
Published on 2010-05-10T12:47:54Z
Indexed on
2010/05/10
12:54 UTC
Read the original article
Hit count: 212
I'm trying to implement a simple way to manage static pages in CakePhp, as described in this article.
The problem I'm facing is that App::import()
doesn't seem to import the required class in the routes.php file.
The code is the following:
App::import('Core','ClassRegistry');
$page = new StaticPage();
$slugs = $page->find('list', array(
'fields' => array('StaticPage.slug'),
'order' => 'StaticPage.slug DESC'
));
I'm getting the error: Fatal error: Class 'StaticPage' not found in ...
I just started CakePhp a few weeks ago and I guess I'm missing a simple thing here...
I'm using CakePhp 1.3 and Php 5.2.42.
© Stack Overflow or respective owner