mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-21 07:37:43 +00:00
fixed a regression introduced by aa6b835816
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
* 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)
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.9-dev"
|
||||
"dev-master": "1.8-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
#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"
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
class Twig_Environment
|
||||
{
|
||||
const VERSION = '1.9.0-DEV';
|
||||
const VERSION = '1.8.1-DEV';
|
||||
|
||||
protected $charset;
|
||||
protected $loader;
|
||||
|
||||
@@ -326,7 +326,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
||||
*/
|
||||
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) {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--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
|
||||
Reference in New Issue
Block a user