У меня есть следующий контроллер, и я получаю ошибку
Notice (8): Undefined property: View::$Paginator [CORE/plugins/forum/views/galleries/index.ctp, line 5]
Контроллер:
<?php
class GalleriesController extends AppController {
var $name = 'Galleries';
function index() {
$this->Gallery->recursive = 0;
$this->set('galleries', $this->paginate());
}
}
?>
Просмотр:
<div class="galleries index">
<h2><?php __('Galleries');?></h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('name');?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($galleries as $gallery):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $gallery['Gallery']['id']; ?> </td>
<td><?php echo $gallery['Gallery']['name']; ?> </td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('action' => 'view', $gallery['Gallery']['id'])); ?>
<?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $gallery['Gallery']['id'])); ?>
<?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $gallery['Gallery']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $gallery['Gallery']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<p>
<?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%', true)
));
?> </p>
<div class="paging">
<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
| <?php echo $this->Paginator->numbers();?>
|
<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
</div>
</div>
<div class="actions">
<h3><?php __('Actions'); ?></h3>
<ul>
<li><?php echo $this->Html->link(__('New Gallery', true), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(__('List Images', true), array('controller' => 'images', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(__('New Image', true), array('controller' => 'images', 'action' => 'add')); ?> </li>
</ul>
</div>