I know compact() is a standard php function. And set() is a cake-specific method.

I am running a simple test of passing a value to a view generated with ajax (user render() in my controller), and it only passes the value from the controller to the view if my setup is like so:

$variable_name_to_pass = "Passing to the view using set() can compact()";

$this->set(compact('variable_name_to_pass'));

From reading the manual, it appears set() should work along w/out compact.

Can anyone explain why set() will not work alone? Like

$this->set('variable_name_to_pass');
Edit
Report