How PHP implements unified text rendering for platform expansion

Source: Internet
Author: User
The requirement is this, in order to achieve a unified format and style of two platform text, to the previous HTML code shaving, because the other platform can not parse the HTML, can only re-set the protocol of the other platform. There is no unified way to solve this problem, I think in the definition of a unified template engine to parse, but for the complex HTML does not seem to have a common approach.

Example code:
Web-side: [♂]$name
Other platforms: $name to implement the above code might be like this

Can realize unification both.

With a set of databases, we now have two options to redefine the template engine but it doesn't seem to be universal. Or the database adds a field to the same $name, stores two copies, reads the time according to the different platform to take out.

There's a better way.

Reply content:

The requirement is this, in order to achieve a unified format and style of two platform text, to the previous HTML code shaving, because the other platform can not parse the HTML, can only re-set the protocol of the other platform. There is no unified way to solve this problem, I think in the definition of a unified template engine to parse, but for the complex HTML does not seem to have a common approach.

Example code:
Web-side: [♂]$name
Other platforms: $name to implement the above code might be like this

Can realize unification both.

With a set of databases, we now have two options to redefine the template engine but it doesn't seem to be universal. Or the database adds a field to the same $name, stores two copies, reads the time according to the different platform to take out.

There's a better way.

Develop a functional module dedicated to parsing.

  • 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.