Openbiz a simple expression of metadata for a technical development manual

Source: Internet
Author: User
Keywords PHP

Intermediary transaction SEO diagnosis Taobao guest Cloud host technology Hall

Meta-data simple expression

To make metadata more flexible, you can use openbiz simple expressions flexibly in metadata files. If a statement has the {expr} pattern, expr is treated as an expression. Basically, an expression is a one-line PHP statement that returns a value. If the user needs more complex logic that cannot be implemented through an expression, the user can also write special logical processing code by associating the metadata with a user-intended object.

Expression label

The system currently supports three expression labels

· {expr} label pair. Openbiz will execute the eval method of PHP to resolve the expr expression string between {}

· {FX}EXPR{/FX} label pair. This is a detailed version of the {} expression implementation. Openbiz also executes the Eval method of PHP to resolve the expr expression string between {FX} and {FX}. For example, {FX}10-1{/FX} will return the result "9".

· {TX}EXPR{/TX} label pair. This pair of tags tells openbiz that only the string itself needs to be returned and not processed, for example: {TX}10-1{/TX} will return the string "10-1".

Use simple expressions

Simple expressions support the binding of a dynamic value to the properties of metadata, and developers can use simple expressions in the following properties.

Bizdataobj

Searchrule, Sortrule, Othersqlrule, Accessrule, Updatecondition, Deletecondition.

Bizfield

Required, Validator, Value, DefaultValue

EasyForm

Title

Element

Link, Style, Hidden, Enabled, Selectfrom

EventHandler

Function, Redirectpage

Data type

A simple expression defines the following data types to remember:

· Boolean type: TRUE or False

· Integer numbers: as defined in PHP

· Floating-point numbers: as defined in PHP

· Strings: Characters enclosed in single and double quotes; "will be escaped to \", ' will be escaped to \ ', \ will be escaped to \.

· Null: null

operator

The simple expression is supported by the following operators:

· Math: +,-(binary), *,/and Div,% and mod,-(unary)

· Logic: And, &&, or, | |, not,!

· Relationship: = = =,!=, <=, >=.

· Condition: A? B:c. Executes a B or C statement according to the return structure of a.

Variable

· Simple expressions allow developers to invoke variables in Openbiz metadata objects,

  

Examples of currently registered plug-in services:

· @validation – Data validation Services

· @query – Data Query services

If you are registering a service, you can add the registration of the service name to the $g_servicealias global variable

By its implementation, developers can add more property support by modifying or overloading the object's GetProperty () method. The input parameters of the GetProperty () function can be either "property_name" or "*[child_name" or some other parameter supported by user-defined code

· The simple expression language industry allows developers to invoke any global variables supported by PHP, for PHP global variables please read http://us2.php.net/manual/en/reserved.variables.php for more information

function

Developers can invoke arbitrary PHP functions in simple expressions, and even user-defined functions can be invoked if the definition of a function is already contained in the file. For example, if metadata A is created based on a user-defined class, the code file for the class is a.php and the file contains A_help.inc, in which case you can safely invoke the custom function defined in the A_help.inc file.

Example

  

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.