ZEF Expression Language – Our first open source contribution
As we already mentioned, we plan to open source our core Convoworks library and make it available for other integrations. Managing an open source project is not a joke. There are whole lot things to cover expect development of some uber-cool new feature that everybody are waiting for. That’s why we decided to test-run and learn the whole process by extracting small reusable chunk as a standalone library and publish it on Github and Packagist.
ZEF Expression Language is the small improvement on Symfony Expression Language component that we developed to overcome some issues we encountered with it.
The first thing is that with it you can evaluate non existing values. Instead of throwing the exception in such case, now it will just evaluate missing value to null and evaluate the rest of expression.
The second improvement is not that much critical. It just gives you ability to use some shorthand syntax.
Instead of referencing an array items with the square brackets now you can use dot notation like in Javascript, meaning that
- myarr[‘name’] === myarr.name
There is also shorthand when referencing object getters:
- myobj.getName() === myobj.name
- myobj.isValid() === myobj.valid
- myobj.hasAny() === myobj.any
The both improvements are inspired with Java Unified Expression Language behavior.
Related posts
Step-by-Step: Building a GPT-Enhanced Twitter Bot with WordPress and Convoworks
Learn to build a GPT-enhanced Twitter bot with WordPress and Convoworks. Automate tweets about your content, leveraging GPT for natural language processing. Perfect for boosting engagement with minimal effort!
VIEW FULL POSTEasy Twitter API Integration Without Coding
Easily integrate Twitter API with WordPress using Convoworks. Automate tweet postings and manage interactions without coding, enhancing your site’s social media presence effortlessly!
VIEW FULL POST