davide wrote: > I've also tried downgrading to cake_0.10.9.2378_final and simplifying > the table with a structure like this > > CREATE TABLE `expenses` ( > `id` int(8) unsigned NOT NULL auto_increment, > `dx` varchar(250) default NULL, > `created` datetime default NULL, > `modified` datetime default NULL, > PRIMARY KEY (`id`) > ) ENGINE=MyISAM DEFAULT CHARSET=utf8 > > but the problem still remain.
Actually I have re-upgraded to the stable version and kept the simple
table. I've avoided the use of scaffolding implementing the index, view
and add functions. Everything works out fine.
What it could be? Do you have any advice of code I can use for checking?
Follows the controller and views
Thanks a lot
Davide
------------
<?php
class ExpensesController extends AppController{
var $name = "Expenses";
function index(){
$this->set('expenses',$this->Expense->findAll());
}
function view($id = null){
$this->Expense->id = $id;
$this->set("expense",$this->Expense->read());
}
function add(){
if(!empty($this->data)){
if($this->Expense->save($this->params["data"])){
$this->flash("saved!","/expenses");
}
}
}
}
?>
------------
<!-- index.thtml -->
<h1>list</h1>
<?php
print_r($expenses);
echo "<ul>";
foreach ($expenses as $expense){
echo "<li>" . $html->link($expense['Expense']['dx'],
"/expenses/view/" . $expense['Expense']['id']) . "</li>";
}
echo "</ul>";
?>
<ul>
<li><a href="/expenses/add">add new</a></li>
</ul>
------------
<!-- view.thtml -->
<?php
print_r($expense);
?>
------------
<!-- add.thtml -->
<h1>Add</h1>
<?=$html->formTag("/expenses/add")?>
dx:<?=$html->input("Expense/dx")?>
<?=$html->tagErrorMsg('Expense/dx', 'dx is required.') ?>
<p><?=$html->submit('Save') ?></p>
</form>
signature.asc
Description: OpenPGP digital signature
