-* 1.9.0 (2012-XX-XX)
+* 1.8.1 (2012-XX-XX)
- * n/a
+ * fixed a regression when dealing with SimpleXMLElement instances in templates
* 1.8.0 (2012-05-08)
},
"extra": {
"branch-alias": {
- "dev-master": "1.9-dev"
+ "dev-master": "1.8-dev"
}
}
}
#ifndef PHP_TWIG_H
#define PHP_TWIG_H
-#define PHP_TWIG_VERSION "1.9.0-DEV"
+#define PHP_TWIG_VERSION "1.8.1-DEV"
#include "php.h"
*/
class Twig_Environment
{
- const VERSION = '1.9.0-DEV';
+ const VERSION = '1.8.1-DEV';
protected $charset;
protected $loader;
*/
protected function getAttribute($object, $item, array $arguments = array(), $type = Twig_TemplateInterface::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false)
{
- $item = (string) $item;
+ $item = is_numeric($item) ? (int) $item : (string) $item;
// array
if (Twig_TemplateInterface::METHOD_CALL !== $type) {
--- /dev/null
+--TEST--
+Twig is able to deal with SimpleXMLElement instances as variables
+--TEMPLATE--
+Hello '{{ images.image.0.group }}'!
+{{ images.children().count() }}
+{% for image in images %}
+ - {{ image.group }}
+{% endfor %}
+--DATA--
+return array('images' => new SimpleXMLElement('<images><image><group>foo</group></image><image><group>bar</group></image></images>'))
+--EXPECT--
+Hello 'foo'!
+2
+ - foo
+ - bar