crossphp 1.5.5 release, lightweight PHP development Framework ~

Source: Internet
Author: User

1.5.5 Update Notes

I. Enhanced annotation configuration

    1. @cp_params all types of URL styles take effect

    2. Enhanced @cp_cache, which can change behavior by injecting anonymous function containers in the portal file

      $app = Cross\delegate::loadapp (' web '); $app->on (' Cpcache ', function (& $cache _config) {    $cache _config[' Key '] = ' abc ';    return true;}); $app->run ();

      At this point, the anonymous function returns the value as a switch that the request cache is active.

    3. @cp_before, @cp_after support the use of the $self-> method name () directly to invoke the internal method of the controller.

Two. Enhanced View Controller

Basic methods

The following methods are added to the view controllers and templates for working with HTML tags, as follows:

    1. The A () method is used to generate a hyperlink

    2. The IMG () method is used to generate a picture connection

    3. Input () processing the form's entry box

    4. Radio (), CheckBox (), select Process Single/check/dropdown

    5. Htmltag () output a separate HTML tag

    6. Wrap () is used to generate complex HTML

      $this->wrap (' div ')     ->wrap (' span ')     ->a (' crossphp ', ' http://www.crossphp.com ');

      The generated HTML code is

                  crossphp    

      See the documentation or discuss it in the official group for more information on how to use

    7. Blocks () output block-level elements with wrap ()

    8. Buildform (form template name), when loading a template into a form, you can register anonymous function buildform in the portal to change the behavior of the framework generated form

      $this->on (' Buildform ', function () {      ...  });
    9. HTML () for secure output HTML content

Layout-related

Section (template name, template data, array wrapped property, wrapper name) in the View controller and template, render different templates according to different logic.

Three. Other optimizations

    1. Specification of some variable naming

    2. Calling the to () method in the controller terminates execution without adding a return to the previous

    3. Determine if the controller and parameters are empty before generating a connection connection

    4. Updated the document

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