From 3d44489b0c2bf20f88403401591685f13de2203d Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 5 Sep 2011 18:33:21 +0100 Subject: [PATCH] Deprecating the %page% style placeholders in PaginatorHelper. Updating scaffold and bake templates to not use deprecated placeholders. --- lib/Cake/Console/Templates/default/views/index.ctp | 2 +- lib/Cake/View/Helper/PaginatorHelper.php | 4 +++- lib/Cake/View/Scaffolds/index.ctp | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/Cake/Console/Templates/default/views/index.ctp b/lib/Cake/Console/Templates/default/views/index.ctp index e78c383e9..e5eb593aa 100644 --- a/lib/Cake/Console/Templates/default/views/index.ctp +++ b/lib/Cake/Console/Templates/default/views/index.ctp @@ -59,7 +59,7 @@

Paginator->counter(array( - 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%') + 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') )); ?>";?>

diff --git a/lib/Cake/View/Helper/PaginatorHelper.php b/lib/Cake/View/Helper/PaginatorHelper.php index 9d12def09..a27ab24de 100644 --- a/lib/Cake/View/Helper/PaginatorHelper.php +++ b/lib/Cake/View/Helper/PaginatorHelper.php @@ -538,12 +538,14 @@ class PaginatorHelper extends AppHelper { * - `model` The model to use, defaults to PaginatorHelper::defaultModel(); * - `format` The format string you want to use, defaults to 'pages' Which generates output like '1 of 5' * set to 'range' to generate output like '1 - 3 of 13'. Can also be set to a custom string, containing - * the following placeholders `%page%`, `%pages%`, `%current%`, `%count%`, `%model%`, `%start%`, `%end%` and any + * the following placeholders `{:page}`, `{:pages}`, `{:current}`, `{:count}`, `{:model}`, `{:start}`, `{:end}` and any * custom content you would like. * - `separator` The separator string to use, default to ' of ' * + * The `%page%` style placeholders also work, but are deprecated and will be removed in a future version. * @param mixed $options Options for the counter string. See #options for list of keys. * @return string Counter string. + * @deprecated The %page% style placeholders are deprecated. */ public function counter($options = array()) { if (is_string($options)) { diff --git a/lib/Cake/View/Scaffolds/index.ctp b/lib/Cake/View/Scaffolds/index.ctp index d2559c6a4..31d850752 100644 --- a/lib/Cake/View/Scaffolds/index.ctp +++ b/lib/Cake/View/Scaffolds/index.ctp @@ -63,7 +63,7 @@ endforeach;

Paginator->counter(array( - 'format' => __d('cake', 'Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%') + 'format' => __d('cake', 'Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') )); ?>