Skip to content

Commit

Permalink
Deprecating the %page% style placeholders in PaginatorHelper.
Browse files Browse the repository at this point in the history
Updating scaffold and bake templates to not use deprecated placeholders.
  • Loading branch information
markstory committed Sep 6, 2011
1 parent 7adcfd6 commit 3d44489
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Console/Templates/default/views/index.ctp
Expand Up @@ -59,7 +59,7 @@
<p>
<?php echo "<?php
echo \$this->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}')
));
?>";?>
</p>
Expand Down
4 changes: 3 additions & 1 deletion lib/Cake/View/Helper/PaginatorHelper.php
Expand Up @@ -538,12 +538,14 @@ public function defaultModel() {
* - `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)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/Scaffolds/index.ctp
Expand Up @@ -63,7 +63,7 @@ endforeach;
</table>
<p><?php
echo $this->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}')
));
?></p>
<div class="paging">
Expand Down

0 comments on commit 3d44489

Please sign in to comment.