1.5.5 Update Notes
I. Enhanced annotation configuration
@cp_params all types of URL styles take effect
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.
@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:
The A () method is used to generate a hyperlink
The IMG () method is used to generate a picture connection
Input () processing the form's entry box
Radio (), CheckBox (), select Process Single/check/dropdown
Htmltag () output a separate HTML tag
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
Blocks () output block-level elements with wrap ()
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 () { ... });
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
Specification of some variable naming
Calling the to () method in the controller terminates execution without adding a return to the previous
Determine if the controller and parameters are empty before generating a connection connection
Updated the document