I would like a way to automatically pass variables from a controller action to a view just by declaring a variable.
So instead of
PHP Code:
<?php
class News extends CI_Controller {
public function index()
{
$data['test'] = "hello";
}
}
I can have
PHP Code:
<?php
class News extends CI_Controller {
public function index()
{
$test = "hello";
}
}
And I can echo $test in the view and the word "hello" appears as the variable is passed
automatically to the view without me having to manually pass it myself.
Ruby framework Ramaze has this feature, and it makes coding much more pleasant.