CakePHP Cookbook 2.x
Adding New Features Indentation Line Length Control Structures Comparison Function Calls Method Definition Method Chaining DocBlocks Including Files PHP Tags Naming Convention Backwards Compatibility set() to pass data from the controller to the view (which we’ll create next). The line sets the view variable called ‘posts’ equal to the return value of the find('all') method of the Post model. Our Post model but for now, let’s just use the default. Remember how in the last section we assigned the ‘posts’ variable to the view using the set() method? That would pass data to the view that would look something like0 码力 | 1096 页 | 958.62 KB | 1 年前3
CakePHP Cookbook 2.x
set() to pass data from the controller to the view (which we’ll create next). The line sets the view variable called ‘posts’ equal to the return value of the find('all') method of the Post model. Our Post model but for now, let’s just use the default. Remember how in the last section we assigned the ‘posts’ variable to the view using the set() method? That would pass data to the view that would look something like message to a session variable to be displayed on the page after redirection. In the layout we have FlashHelper::render() which displays the message and clears the corresponding session variable. The controller’s0 码力 | 820 页 | 2.52 MB | 1 年前3
CakePHP Cookbook Documentation 5.xFeatures IDE Setup Indentation Line Length Control Structures Comparison Function Calls Method Definition Bail Early Method Chaining Commenting Code Including Files PHP Tags Naming Convention Careful when Name Forms Inflector::classify Inflector::dasherize Inflector::tableize Creating Variable Names Inflector::variable Inflection Configuration Loading Custom Inflections Number Number Formatting Currency pluginSplit() namespaceSplit() Core Definition Constants APP APP_DIR CACHE CAKE CAKE_CORE_INCLUDE_PATH CONFIG CORE_PATH DS LOGS RESOURCES ROOT TESTS TMP WWW_ROOT Timing Definition Constants TIME_START Chronos0 码力 | 1080 页 | 939.39 KB | 1 年前3
CakePHP Cookbook 4.x
Features IDE Setup Indentation Line Length Control Structures Comparison Function Calls Method Definition Bail Early Method Chaining Commenting Code Including Files PHP Tags Naming Convention Careful Name Forms Inflector::classify Inflector::dasherize Inflector::tableize Creating Variable Names Inflector::variable Inflection Configuration Loading Custom Inflections Number Number Formatting Currency pluginSplit() namespaceSplit() Core Definition Constants APP APP_DIR CACHE CAKE CAKE_CORE_INCLUDE_PATH CONFIG CORE_PATH DS LOGS RESOURCES ROOT TESTS TMP WWW_ROOT Timing Definition Constants TIME_START SECOND0 码力 | 1249 页 | 1.04 MB | 1 年前3
CakePHP Cookbook 3.x
Features IDE Setup Indentation Line Length Control Structures Comparison Function Calls Method Definition Bail Early Method Chaining Commenting Code Including Files PHP Tags Naming Convention Careful when and under_scored Forms Creating Human Readable Forms Creating Table and Class Name Forms Creating Variable Names Creating URL Safe Strings Inflection Configuration Loading Custom Inflections Number Formatting Using Namespaces Creating a Child Constants & Functions Global Functions Core Definition Constants Timing Definition Constants Chronos Debug Kit Migrations ElasticSearch Appendices 3.x Migration Guide0 码力 | 1244 页 | 1.05 MB | 1 年前3
The PHP Handbook
6. PHP language basics 6.1. Variables 6.2. Comments 6.3. Types 6.4. Printing the value of a variable 6.5. Operators 7. Strings 8. Built-in functions for numbers 9. Arrays 9.1. Useful functions followed by an identifier, which is a set of alphanumeric chars and the underscore _ char. A variable can be assigned any type of value, like strings (defined using single or double quotes): $name Once a variable is assigned a value, for example a string, we can reassign it a different type of value, like a number: $name = 3; PHP won’t complain that now the type is different. Variable names0 码力 | 97 页 | 8.78 MB | 1 年前3
CakePHP Cookbook 3.x
Name Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 899 Creating Variable Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 900 . . . . . . . . . . . . 931 Core Definition Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 933 Timing Definition Constants . . . . . . . . . . . . ?> In the last section we assigned the ‘articles’ variable to the view using set(). Variables passed into the view are available in the view templates as local0 码力 | 967 页 | 2.80 MB | 1 年前3
CakePHP Cookbook Documentation 5.xName Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779 Creating Variable Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780 . . . . . . . . . . . . 813 Core Definition Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 815 Timing Definition Constants . . . . . . . . . . . . ?> In the last section we assigned the ‘articles’ variable to the view using set(). Variables passed into the view are available in the view templates as local0 码力 | 848 页 | 2.53 MB | 1 年前3
CakePHP Cookbook 4.x
Name Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891 Creating Variable Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892 . . . . . . . . . . . . 927 Core Definition Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 929 Timing Definition Constants . . . . . . . . . . . . ?> In the last section we assigned the ‘articles’ variable to the view using set(). Variables passed into the view are available in the view templates as local0 码力 | 967 页 | 2.88 MB | 1 年前3
Falcon v1.0.0 Documentationprocess_request(self, req, resp): # req.stream corresponds to the WSGI wsgi.input environ variable, # and allows you to read bytes from the request body. # # See also: PEP 3333 application = falcon.API() That creates your WSGI application and aliases it as api. You can use any variable names you like, but we’ll use application since that is what Gunicorn expects it to be called, by let’s create a hook that will run before each request to post a message. Add this method below the definition of ALLOWED_IMAGE_TYPES: def validate_image_type(req, resp, resource, params): if req.content_type0 码力 | 312 页 | 368.58 KB | 1 年前3
共 74 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8













