Alright, I got something working:
Model
<?php
class Project extends AppModel {
var $name = 'Project';
var $primaryKey = 'project_id';
}
?>
Controller
class ProjectsController extends AppController {
var $name = 'Projects';
function manage($id=0){
$this->Project->id = $id;
$this->set('project', $this->Project->read());
}
}
?>
View
<?php
print_r($project);
echo "<h1>".$project['Project']['adress']."</h1>";
?>
However, I was initially trying this in my view:
echo $this->data['Projects']['project_id'];
or
echo $this->data['Project']['project_id'];
and I was getting nothing.
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" 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