just add:
$this->autoRender = false;
just add:
$this->autoRender = false;
print_r($this -> Session -> read());
$this -> Session -> write("variable", "value");
$this -> Session -> read("variable");
$user_email = $this -> data['User']['email']; $user = $this -> User -> find("email = '$user_email'"); $this -> Session -> write('User', $user['User']);
$this -> Session -> read("User.email");
if ($this -> Session -> valid()){ $this -> Session -> destroy(); $this -> redirect('/'); }
Source: http://justkez.com/understanding-cakephp-sessions/
Use Model::read() when you have the ID, ie: you know the record you are referring to. Also read() will populate the Model::$data in a way suitable for Model::save() while find() will simply return the resultset array.
Use find() / findAll() / find(‘all’) to find records.
Both methods should fetch associated models given the correct Model::$recursive value.
Model::read is only a wrapper for Model::find
Source:
http://n2.nabble.com/Difference-between-read-and-find-td726658.html
Again a simple tip. CakePHP by default, in order to optimize performance, has a query caching system. This is a very cool feature but sometimes it may be self-defeating. For example when you do queries for Unit Testing.
In order to disable query caching, it’s enough to set the model cacheQueries variable to false. Setting it to true will re-enable queries caching.
You can disable it for the whole model “life-time” setting it during “design time”
<?php
class Project extends AppModel {
var $name = "Project";
var $customValidate = array("name");
var $cacheQueries = false;
...
?>
or you can temporarily disable it by calling the $this->Model->cacheQueries=false (use your model instead of “Model”)
Source:
http://edivad.wordpress.com/2008/04/15/cakephp-disable-model-queries-caching/
I needed Dreamweaver to recognize a new file extension called, “thtml” for CakePHP. Here is how I got Dreamweaver to recognize new code extensions and highlight them correctly:
Here is the full article by Adobe: Adobe: Changing and adding file extensions recognized by Dreamweaver
Source:
http://marcgrabanski.com/article/edit-cakephps-thtml-with-dreamweaver