Yii 1.1.3

    Yii framework

    The Yii framework continues to actively develop, and now a new version 1.1.3 has appeared. What kind of framework is this and what they eat with it - read here , and who is in the know - get acquainted with the list of innovations.

    Active record

    URLs
    • Added properties CHttpRequest :: port and CHttpRequest :: securePort , indicating the ports for insecure and protected requests. By default, 80 and 443 respectively.
    • Improved defaultParams in CUrlManager . This property was added back in 1.0.8 and is used to describe the rules for generating URLs. When the rule is triggered, the parameters from this property are added to $ _GET. Now when you create links (for example, using CController :: createUrl () ), if the parameter is set, which is the same as with any parameter of defaultParams , this parameter is not specified additionally in the created link.
    • When using parameterized hostnames , relative links (URLs) will now be created if the hostname specified in the rule matches the current one.

    CSecurityManager
    • In CSecurityManager added ability to specify an algorithm for encryption / decryption and hashing. The new properties of hashAlgorithm and cryptAlgorithm are responsible for this . Now you can use not only the usual md5 or sha1, but many other algorithms.

    CSort
    • The CSort :: defaultOrder property can now use the virtual attributes defined in CSort :: attributes . You need to do this with the help of an array, where the keys of the array are the names of virtual attributes, and the values ​​of the array are logical values ​​(true or false), indicating whether the sorting should be decreasing.
    • Also in CSort :: attributes there is a new option 'default' (in addition to 'asc', 'desc' and 'label'), which requires ascending or descending ordering when the user clicks on the corresponding sorting link for the first time. The option can take the values' asc 'or' desc.
    • And in CSort :: attributes , next to other virtual attributes, you can insert the '*' element, and all attributes of the AR class specified in CSort :: modelClass will automatically be available for sorting.

    CHtml

    Themes and skins
    • Now in the application configuration, you can configure the default values ​​for widgets. You can read more about this in the documentation for skins .
    • Improved work with views to support the use of graphical application themes in the module. In this regard, there was a new syntax for view-filename:
      • "// layouts / main" points to "protected / views / layouts / main.php" (if "protected" is the base directory of the application)
      • "/ layouts / main" points to "protected / modules / abc / views / layouts / main.php" (if "abc" is the current working module. If not, then this is the same as "// layouts / main ")
      • “Main” points to a view file located in the directory of representations of the current controller or in the directory of the current layout.

    Javascript

    Miscellaneous

    Actions when migrating from version 1.1.2


    • If you use widget skins, be sure to set the 'enableSkin' property of the 'widgetFactory' application component to true. Also, if for the previous version you configured the 'widgets' property, now you need to rename it to 'skinnableWidgets'.
    • CAutoComplete has been abolished and now you need to use CJuiAutoComplete .
    • Now you cannot reuse CActiveFinder . For example, if there is a code:, then it should be rewritten as follows:
      $finder = Post::model()->with('comments');
      $posts1 = $finder->findAll();

      $posts2 = $finder->findAll();

      $posts1 = Post::model()->with('comments');

      $posts2 = Post::model()->with('comments');


    Also popular now: