Yii is een component-based PHP-framework, met volgens de ontwikkelaars zeer goede prestaties, die bijzonder geschikt zijn voor het ontwikkelen van grootschalige webapplicaties. Het framework bevat tal van opties, zoals mvc, dao/ActiveRecord, I18N/L10N, caching, jQuery-based AJAX support, scaffolding, input validation, widgets, events en theming. Voor meer informatie verwijzen we naar deze pagina. De ontwikkelaars hebben versie 1.1.7 uitgebracht met de volgende aankondiging:
Yii PHP framework 1.1.7 is released
We are very pleased to announce the immediate availability of Yii Framework version 1.1.7. In this release, we included more than 90 new features, enhancements and bug fixes.
For the complete list of changes in this release, please see the change log and important feature additions . And if you plan to upgrade from an older version to 1.1.7, refer to the upgrade instructions.
In the following, we briefly introduce some of the most exciting new features in this release. Thank you for your support!
RESTful URL Support
To let CUrlManager to recognize specific HTTP verbs and respond accordingly, one can specify the verb option in the URL rules in the application configuration.
Built on top of data caching, query caching stores the result of a DB query in cache and may thus save the DB query execution time if the same query is requested in future, as the result can be directly served from the cache. Query caching can be used at both DAO and AR levels.
Parameter Binding for Class-based Actions
In version 1.1.4, we added support for automatically populating method-based action parameters. In this version, we extended this support to class-based actions.
Seamless Client-side Validation
CActiveForm is a powerful widget that makes creating form and performing data validation very easy. Previously, CActiveForm supports server-side validation and AJAX-based validation. In this version, we enhanced CActiveForm further with client-side validation. Compared with server-side and AJAX-based validations, the new validation is performed entirely on the client side. Therefore, it can give more prompt response to user inputs and will not bring any extra workload on the server. The best thing about this client-side validation is that it does not require any extra coding. The validation is done based on the validation rules declared in the model class, and the result is consistent with that done on the server side. All these make our code more DRY. To use client-side validation, we simply need to set CActiveForm::enableClientValidation to be true.
Passing Parameters to Relational Named Scopes
It's now possible to pass parameters for relational named scopes.
Using 'through' with HAS_MANY and HAS_ONE
Active Record got through support that allows to build MANY_MANY-like relations with much more flexibility allowing getting and using data from the binding in-the-middle table. For example, it allows getting all comments for all users of a particular group.
Using Transactions in DB Migration
When performing DB migration, we may encounter situations where a part of a migration fails and we want to roll back the whole migration. The solution to this problem is to enclose the whole migration code within a DB transaction. While we can explicitly write this code, the new transaction support for DB migration makes the whole task a lot easier. Instead of implementing CDbMigration::up() and CDbMigration::down(), we can put our code in CDbMigration::safeUp() and CDbMigration::safeDown(). By doing so, our code will be protected by DB transaction. In case any DB operation fails in the middle, the whole migration will be rolled back. Note that in order to use this feature, you DBMS must support transactions.
Registering and Using Custom Script Packages