mysql にblogでpostsデータベースを作成して
Index of /blog
Parent Directory
.DS_Store
.idea/
cakephp/
上記ページが出て cakephp を選んでクリックすると
Release Notes for CakePHP 1.3.14.
Read the changelog
Your tmp directory is writable.
The FileEngine is being used for caching. To change the config edit APP/config/core.php
Your database configuration file is present.
Cake is able to connect to the database.
と成功したかの様な画面。
そのご、controllersの下に
posts_controllers.php と名前のつけたソースを作成しました。
<?php
class Post extends AppModel
{
var $name = 'Post';
var $scaffold ;
}
?>
ブラウザで
パス blog/cakephp/posts
で実行すると
Fatal error: Class 'AppModel' not found in /Applications/XAMPP/xamppfiles/htdocs/blog/cakephp/app/controllers/posts_controller.php on line 3
でエラーになりました。
原因が特定できません。なにとぞよろしくお願いいたします。
php v5.3.1 です。
class Post extends AppModel
{
var $name = 'Post';
var $scaffold ;
}
?>
はモデルクラスなので
/app/models/Post.php にあるべきクラスです
posts_controller.phpは
class PostsController extends AppController
とするのが正しいです
参考URL
http://book.cakephp.org/1.3/ja/view/955/コントローラ
ありがとうございます。!!!!!
2012/03/18 12:53:18いけました。
もっとcakephpを勉強していきます。