harrydeluxe / php-liquid

A PHP port of Ruby's Liquid Templates
http://www.delacap.com/artikel/Liquid-Templates/
MIT License
239 stars 117 forks source link

Duplicated codebase hinders functionality. #21

Closed maddes closed 8 years ago

maddes commented 10 years ago

Objects properties were unable to be accessed due to misplaced code.

The chunk of code removed (lines 272..279) rendered the following (308..350) useless in case of an object variable.

Now, I can safely do as follows:

  class Foo 
  {
    public $bar = "Hello World!";
  }
  $assigns = array('foo' => new Foo);
  print $liquid->render($assigns);

and then access the property in the template with:

  {{ foo.bar }}

Otherwise, it just throwed the LiquidException with message Method 'toLiquid' not exists!

chros73 commented 10 years ago

Hi Maddes!

Thanks for your contribution! I have seen that you have created a different repo for your changes. I have modified my copy as well to include this change: https://github.com/harrydeluxe/php-liquid/issues/14 If you like it, you can put it on yours as well. Feel free to comment it! :)

Krisztian

maddes commented 10 years ago

Yep, well, I'm doing MAYOR changes. Basically I'm making the whole library Composer and PSR-4 Compliance.