1.3.x under Microsoft Windows
Apache 2.x under Microsoft Windows
Sun,iplanet and Netscape servers under Microsoft Windows
Sambar server under Microsoft Windows
Xitami under Microsoft Windows
Compiling from source program
Installing the Extensions library under Windows
command-line mode for PHP under Microsoft Windows
Installation on a cloud computing platform
Microsoft Azure
Amazon EC2
FastCGI Process Manager (FPM)
This article from the official blog, slightly added: https://github.com/mesos/spark/wiki/Spark-Programming-GuideSpark sending Guide
From a higher perspective, in fact, every Spark application is a Driver class that allows you to run user-defined main functions and perform various concurrent operations and calculations on the cluster.
The most important abstraction provided by Spark is a personalized distri
component. In this case, the behavior bound first has priority.
When used together with events, the behavior is more powerful. When a behavior is bound to a component, some methods in the behavior can be bound to some events of the component, so that the behavior can observe or change the general execution process of the component.
Starting from version 1.1.0, a behavior attribute can also be accessed by the bound component. These attributes include public member variables and attributes set th
( 'application.filters.PerformanceFilter - edit, create', 'unit'=>'second', ), ); }}
The above code specifies two filters: postOnly and PerformanceFilter. PostOnly filters are method-based (the corresponding filter methods have been defined in CController), while performanceFilter filters are object-based. Path alias application. filters. cecefilter specifies that the filter class file is protected/filters/cecefilter. We use an array to configu
($ items as $ I => $ item) {if (isset ($ _ POST ['item'] [$ I]) $ item-> attributes =$ _ POST ['item'] [$ I]; $ valid = $ valid $ Item-> validate ();} if ($ valid) // if all projects are valid //... perform some operations here} // display the View collection table input $ this-> render ('batchupdate', array ('items '=> $ items ));}
We have prepared this action, and we need to continue.batchUpdateView to display input items in an HTML table.
Name
Price
Count
Des
table. Creates a controller class for each type of user request. How to classify user requests depends on actual needs. In general, if a model class needs to be accessed by the user, it should have a corresponding controller class.GiiThe tool can also automatically perform this step.
Implement actions and their corresponding views. This is what you really need to do.
Configure necessary action filters in the controller class.
Create a topic if you need the topic function.
If you want to
second will only returnFirstError message.6. feature labels
When designing a form, we usually need to display a label for each form field. The tag tells the user what information he should fill in this form field. Although we can hard encode a tag in the view, it is more flexible and convenient if we specify the tag in the corresponding model.
By default, CModel uses the name of a simple returned feature as its tag. This can be customized by overwriting attributeLabels. As we will see in the fo
'=> array ('get') {?>... Cached content...
EndCache () ;}?>... Other HTML content...
2. Nested cache (Nested Caching)
Fragment cache can be nested. That is to say, a cache segment is attached to a larger segment cache. For example, the comments are cached in the internal segment, and they are cached in the article content together in the external cache.
Other HTML contents...
BeginCache ($ id1) {?>... Externally cached content...
BeginCache ($ id2) {?> Contents cached inside...
EndCache (
)
Validator must inherit from CValidator and implement the CValidator: validateAttribute method.
class MyValidator extends CValidator{ protected function validateAttribute($model,$attribute) { $value=$model->$attribute; if($value has error) $model->addError($attribute,$errorMessage); }}
8. Console Command (Console Command)
The console command should inherit the CConsoleCommand and implement the CConsoleCommand: run method. Alternatively, we can overload CConso
auto-incrementing sequence value of the table's primary key, and inserts data rows from a specific state file into the table to reset the table.
Sometimes, we may not want to reset each table described in a specific state file before a set of tests, because resetting too many specific state files may take a lot of time. in this case, we can write a PHP script to customize the initialization process. this script should be saved in the directory where the specified state file is stored and namedi
example, if you want to migrate a Forum module, all its migration files are placed in the migration folder of the module, you can use the following command:
yiic migrate up --migrationPath=ext.forum.migrations
Note that when you set a boolean option such as interactive, use the following method to pass 1 or 0 to the command line:
yiic migrate --interactive=0
Configure global commands
The command line option allows us to quickly configure the migration command, but sometimes we may want to confi
array with the following structure:
code: HTTP status code (such as 403,500 );
type: Error type (such as CHttpException,PHP Error);
message: Error message;
file: The PHP file name is incorrect;
line: The row where the error is located;
trace: Incorrect call stack information;
source: Context of the error code.
Tip:The reason for checking whether CErrorHandler: error is null iserrorActions can be accessed by users. at this time, there may be no errors. When we pass$errorArray to the v
value is returned, the application exits and returns 0.5. Custom console applications
By default, if an application is created using the yiic webapp tool, the configuration of the command line application will be placed in protected/config/console. php file. like a Web application configuration file, this file is a PHP script that returns the array of initialization configuration values of the console application instance. Therefore, any public attribute of CConsoleApplication can be configured
the application configuration file, while the latter usesmain.php.
Now let's start to talk about how to test and display the feature of an article in the blog demonstration. First, write a Test class for example. Note that the test class inherits from the base class WebTestCase described above:
class PostTest extends WebTestCase{ public $fixtures=array( 'posts'=>'Post', ); public function testShow() { $this->open('post/1'); // verify the sample post title exist
, $matches)) { // check $matches[1] and $matches[3] to see // if they match a manufacturer and a model in the database // If so, set $_GET['manufacturer'] and/or $_GET['model'] // and return 'car/index' } return false; // this rule does not apply }}
The custom URL rule class must implement the two interfaces defined in CBaseUrlRule.
[CBaseUrlRule: createUrl () | createUrl ()]
[CBaseUrlRule: parseUrl () | pars
indicate an error.
In the Run () method of an action method or console command, you can return an integer value exit code on exit, for example:
if (/* ERROR */) { return 1;//exit with error code 1}//... "Do something ... return 0;//exit successfully
If there is no return value, the app exits returning 0.
5. Customizing the console App
By default, if an app was created using the YIIC webapp tool, the command line app's configuration will be placed in the protected/config/console.php file.
, the application needs to define the mappings from the WSDL type to the corresponding PHP class. This is done by configuring the Cwebserviceaction property Classmap.
Class Postcontroller extends ccontroller{public function actions () { return Array ( ' service ' = Array ( ' class ' = ' cwebserviceaction ', ' Classmap ' =>array ( ' post ' = ' post ', //or simply ' Post ' ),) , ); }
.
Info: Using skin may degrade the performance because YII needs-look for the skins file the first time a widget is being create D.
Skin is very similar to the Global Widget customization feature. The main differences is as follows.
Skin is more related with the customization of presentational property values;
A widget can have multiple skins;
Skin is themeable;
The using skin is the more expensive than using global widget customization.
The above is the Yii Framewor
displaying an article in a blog presentation. First write the test class as written, notice that the test class inherits from the base class Webtestcase we described above:
Class Posttest extends webtestcase{public $fixtures =array ( ' posts ' = ' Post ', ); Public Function Testshow () { $this->open (' post/1 '); Verify the sample post title exists $this->asserttextpresent ($this->posts[' sample1 ' [' title ']); Verify comment form exists $
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.