Comments (5)
As a side note, a new plugin (or this one) could be used to introduce the twig/intl-extra
composer package (described above) and register its extension. That would be pretty cool.
To retrofit this one:
- Create a branch called
1.x
for the current code, you can continue to maintain 1.x tags from this branch - Update this plugin to offer the new features
- Require
october/rain
at>=3.1
like we have done with the translate plugin - Publish the plugin as 2.0 (tag as
v2.0.0
) - Set the supported version on the October CMS marketplace under "Compatibility" to protect v1 sites from getting the new version
I hope this helps!
from oc-twigextensions-plugin.
One more thing @daftspunk maybe related to html_mailto issue above:
{{ '<p><strong>Test</strong></p>'|html_strip('<p>')|raw }}
When using html_strip with specify allow tags, I have to use raw filter, otherwise, it renders HTML entities.
I've prepared and tested twig/intl-extra
integration and the new plugin's version is almost done! :-) Just polishing readme etc.
from oc-twigextensions-plugin.
Thank @daftspunk for your help! I started to work on a new version/branch and have a few questions/notes (tested on OctoberCMS 3.1.17):
a) {{ "October CMS" | str_replace('CMS', 'ERP') }}
returns ERP, not October ERP... looks like it works only like that: `{{ str_replace('CMS', 'ERP', 'October CMS') }}
b) arr_shuffle
not works, nor the array_shuffle
, nor the shuffle
... it throws a "not existing filter" exception
c) {{ '[email protected]'|html_mailto|raw }} requires raw
on the end, otherwise returns just HTML encoded version
from oc-twigextensions-plugin.
Thanks, @vojtasvoboda!
a) This is a bug, fixed in v3.1.18
b) Oops, I thought, arr_*
proxied to \Arr::*
. We should be using collect().shuffle()
here anyway. Docs have been updated:
{{ collect(songs).shuffle() }}
c) Another bug, fixed in v3.1.18
from oc-twigextensions-plugin.
Ok, we can fix this in the next patch. It looks like all html_
functions and filters should not be escaped. It should be fixed in 3.1.19
Great work on the release!
from oc-twigextensions-plugin.
Related Issues (20)
- Translations sets days months and year with value 1 HOT 1
- base64_encode/decode (enhancement) HOT 1
- Having trouble with the Arabic language HOT 6
- Custom plugin and custom lang.php file HOT 1
- ucfirst filter has wrong behavior.
- Plugin update error HOT 2
- Group By function? HOT 5
- Class 'Twig_Extensions_Extension_Text' not found with OctoberCMS v1.1.1 HOT 5
- Plugin prevents password retrieval HOT 1
- mode-js.js for October plugin - Twig Extensions (I think) HOT 1
- "Target class [twig.environment] does not exist" while running phpunit HOT 1
- Class "Twig_Extension_StringLoader" not found HOT 14
- New version won't update HOT 9
- october 3.x HOT 3
- Struggling to update to latest version HOT 7
- Incompatible with October v3.0 HOT 4
- Class "IntlDateFormatter" not found HOT 9
- Error with format_datetime() HOT 9
- Unknown "truncate" filter. HOT 3
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 oc-twigextensions-plugin.