Comments (3)
@hofrob @machour I use this extension in my personal project, so I can confirm it's fully working. As I mentioned the code was copied from craftcms and adjusted to pass all tests. It seems these three lines are irrelevant:
if ($object instanceof ElementInterface) {
self::_includeElementInTemplateCaches($object);
}
... but weird code inside is not executed - instanceof
returns false
. It's really interesting that you can provide any class name, even non-existing one and PHP won't leave you error nor warning.
To sum up extension is not broken and it'is working fine, but contain few unnecessary lines which doesn't matter. I'll prepare PR to get rid of them.
@hofrob nice catch btw.
from yii2-twig.
I can confirm that the 2.2.x branch looks really odd..
I don't see that much oddness in 2.1.1, could you try downgrading to that version and see what's what?
https://github.com/yiisoft/yii2-twig/tree/2.1.1
from yii2-twig.
Thanks for the quick replys! Will try 2.1.1 and report back. At first glance this does look better.
The version we used had the erroraenous comparison instanceof Object
(which causes getters to be executed twice) and I was about to do a PR until I saw yii\twig\Template
in the master branch.
If I have something worth contributing, I will do that.
from yii2-twig.
Related Issues (20)
- How to include one macro in another macro from different twig file? HOT 3
- Incompatible with Twig 2.7.2 HOT 2
- twig and i18n HOT 4
- Mail twig templates HOT 2
- Is there any other way use static classes in twig file without adding globals? HOT 3
- The $context arg in render don't preserve the "internal context" in a double call of render HOT 6
- Twig_Extension_Debug extension doesn't Work HOT 3
- Π‘an't call a static method of the model HOT 5
- PHP 8.1 support
- Error when including twig files without absolute links HOT 1
- Update documentation to remove reference to relative twig paths HOT 1
- Object of class yii\widgets\Pjax could not be converted to string
- update irc link
- update github folder link
- update src folder links
- update docs folder links
- update tests folder links
- update src folder links
- An exception has been thrown during the rendering of a template ("Call to undefined function twig_get_attribute()"). HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-twig.