Working with structured data
So far, our custom expression language has only supported very simple variables-numbers and Boolean values. However, in real applications, this is often not so simple. When using an expression language to offer programmable business rules, you will often be working with structured data. For example, consider an e-commerce system in which a back-office user has the possibility to define under which conditions a discount should be offered to a user and what amount of a purchase should be discounted (the following figure shows a hypothetical example of how such a feature might actually look in an application).
Typically, you do not know beforehand how a user is going to use this feature. Using only numerical variables, ...
Get PHP 7 Programming Blueprints now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.