Hi AD7six,
I set the debug value to 3, but nothing has changed. When I use,
$this->data = $this->Article->findAll(); everything works fine. I am
able to access data value in my view. But when I try
$this->set('data', $this->Article->findAll()), I get following error in
my message.
Warning: Invalid argument supplied for foreach() in
C:\Apache2\htdocs\cake\app\views\general\show.thtml on line 3
But for other controllers $this->set('data', $this->Article->findAll())
works fine.
For reference, I am placing the controller and view code that is
working for me
========== general_controller.php ===========
<?php
class GeneralController extends AppController
{
var $name = 'General';
var $uses = array('Article', 'Author', 'Keyword', 'Authorship',
'UserArticleTag');
var $components = array('Autocomplete');
var $helpers = array('Php');
var $data;
function show(){
$this->data = $this->Article->findAll();
}
}
?>
============ view/general/show.thtml -=================
<h1> Article List </h1>
<?php
foreach($this->data as $key=>$value){
print('<hr/>');
print('Key = ' . $key . '<br/>');
print_r($value);
}
echo $php->array2table($this->data, true);
?>
================================
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---