Upgrading Dwoo (to 1.1.1)
There are some critical bugs in Dwoo 1.0 (which comes FuelCMS) and I need to upgrade it to 1.1.1 which has bunch of other fixes. The folder structure seems to be the same. However I bet there are some constants and modifications to make it work with fuel. Do you know which are the modified files so I can copy the modified parts when I'm upgrading to 1.1.1 ?
Comments
The next major release will have the latest version of Dwoo BTW.
Lines 200-202:
$tpl = new Dwoo_Template_String($string); $dwoo = $is_include ? self::spawn() : $this->_dwoo;
Replace with:
$dwoo = $is_include ? self::spawn() : $this->_dwoo; if($data['viewer']){//checks if template is loaded from a file or string $dwoo->setSecurityPolicy(); //Wipe security policy to load file outside of Dwoo dir $tpl = new Dwoo_Template_File($data['viewer']); } else tpl = new Dwoo_Template_String($string);
With the $data['viewer'} set in the controller to the absolute path to the view file e.g:
$data['viewer'] = MODULES_PATH.'test_module/views/test2.php';
The $data object refers to Dwoo insde the templates and you get PHP variables like: $data->viewer
and the CI object with $data->CI
But you can use the template variables like {$CI} instead of {$data->CI} which is a bit confusing... I've been looking for a while now and can't think of a way use the PHP variables without the "$data->" unless I do:
foreach($data as $k=>$v){ $$k = $v; }
which isn't quite the best solutions since you need to include it into all view files used. I want to include it somewhere before rendering the template so I don't need to have that code in every view file I make.