MINOR: Add upgrade docs covering the changes to ViewableData

This commit is contained in:
Hamish Friedlander 2012-02-20 10:30:28 +13:00
parent 407913f2cf
commit f8edc4bd13
2 changed files with 58 additions and 2 deletions

View File

@ -13,9 +13,19 @@
## Upgrading ##
### New template engine
### New template engine ###
The template engine has been completely rewritten, and although it is generally backward compatible, there are new features and some features have been deprecated. See the [template upgrading guide](/reference/templates-upgrading-guide) and the [template reference](/reference/templates) for more information.
The template engine has been completely rewritten, and although it is generally backward compatible, there are new features
and some features have been deprecated. See the [template upgrading guide](/reference/templates-upgrading-guide) and the
[template reference](/reference/templates) for more information.
#### Removed view-specific accessors from ViewableData ####
Several methods in ViewableData that were originally added to expose values to the template language were moved,
in order to stop polluting the namespace. These were sometimes called by project-specific PHP code too, and that code
will need re-working.
See the [template upgrading guide](/reference/templates-upgrading-guide) for a list of methods and their replacements.
### New user interface for CMS ###

View File

@ -40,3 +40,49 @@ Within a tag, a single space is equivalent to multiple consequetive spaces. e.g.
is equivalent to
<% if $Foo %>
## Removed view-specific accessors
Several methods in ViewableData that were originally added to expose values to the template language were moved,
in order to stop polluting the namespace. These were sometimes called by project-specific PHP code too, and that code
will need re-working.
#### Globals
Some of these methods were wrappers which simply called other static methods. These can simply be replaced with a call
to the wrapped method. The list of these methods is:
- CurrentMember() -> Member::currentUser()
- getSecurityID() -> SecurityToken::inst()->getValue()
- HasPerm($code) -> Permission::check($code)
- BaseHref() -> Director::absoluteBaseURL()
- AbsoluteBaseURL() -> Director::absoluteBaseURL()
- IsAjax() -> Director::is_ajax()
- i18nLocale() -> i18n::get_locale()
- CurrentPage() -> Controller::curr()
#### Iterator-specific
Some of the removed methods were utilities that exposed the current state of the current scope's iteration. These
currently have no replacement. The list of these methods is:
- First
- Last
- FirstLast
- Middle
- MiddleString
- Even
- Odd
- EvenOdd
- Pos
- TotalItems
- Modulus
- MultipleOf
#### Scope-exposing
Some of the removed methods exposed access to the various scopes. These currently have no replacement. The list of
these methods is:
- Top