AD7six said:
> but the error is probably here: $data =$this->Post->findAll();
>
> and not here: $this->set('data',$data);
You are right. I was investigating and the problem is in the Post. It
_seems_ not to be initialized. I've tried something like
$this->set("data",null); and worked fine.
> Does that function work via the browser, if so how does the test suite
> load models..? It should be triggered by the controller constructor.
> Any possibility that cake is trying to show you an error message (any
> clues in the $post array)?
The Posts controller works fine. If I call /posts/index I get a page with
sql statements[1].
The main problem is that I don't know how to use the testsuite, so I don't
know if I have to manually load each component (controller and model) or
it should be handled manually by the suite.
However here[2] is the print_r($posts).
Bye and thanks
Davide
1. SELECT `Post`.`id`, `Post`.`user_id`, `Post`.`title`, `Post`.`body`,
`Post`.`created`, `Post`.`modified`, `Post`.`status` FROM `posts` AS
`Post` WHERE 1 = 1
2. postscontroller Object
(
[_log] =>
[name] => Posts
[here] =>
[webroot] =>
[action] =>
[uses] =>
[helpers] => Array
(
[0] => Html
)
[params] => Array
(
)
[data] => Array
(
)
[viewPath] => posts
[viewVars] => Array
(
)
[pageTitle] =>
[modelNames] => Array
(
)
[base] =>
[layout] => default
[autoRender] => 1
[autoLayout] => 1
[components] => Array
(
[0] => Locale
)
[view] => View
[ext] => .thtml
[__viewClass] =>
[output] =>
[plugin] =>
[cacheAction] =>
[persistModel] =>
[beforeFilter] =>
[webservices] =>
[modelClass] => Post
[modelKey] => post
)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---