Upgrading Dwoo (to 1.1.1)

edited March 2012 in Modules
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

  • edited 8:10PM
    I believe you can simply copy over everything. The code to get it to work is in the MY_Parser class but shouldn't need to be changed.

    The next major release will have the latest version of Dwoo BTW.
  • edited 8:10PM
    It seems to be working fine when I copied it over. however, i noticed dwoo is abit outdated(last update from 2 years ago) and the Extends feature which is one of the best things about it still doesnt function as intended after the update so im either gonna try to fix it or replace it smarty.
  • edited 8:10PM
    Turns out the error with the Extending feature was caused by My_parser, it was using Dwoo_templete_string which doesn't handle it well. I will post my solution later if any1 has the same problem.
  • edited 8:10PM
    Yes... please do when you can.
  • edited April 2012
    fuel/application/libraries/MY_Parser.php
    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.
Sign In or Register to comment.