index.ctp 2.43 KB

<div class="sousCategories index">
<?php echo '<h2><i class="icon-list"></i> Liste des sous-catégories</h2>'; ?>
    <table cellpadding="0" cellspacing="0">
        <thead>
            <tr>
                <th><?= $this->Paginator->sort('nom', 'Nom') ?></th>
                <th><?= $this->Paginator->sort('categorie_id', 'Catégorie') ?></th>
                <th class="actions"><?= __('') ?></th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($sousCategories as $sousCategory): ?>
            <tr>
                <td class="smallText"><?= $this->Html->link($sousCategory->nom, ['action' => 'view', $sousCategory->id]) ?></td>
                <td class="smallText"><?= $sousCategory->has('category') ? $this->Html->link($sousCategory->category->nom, ['controller' => 'Categories', 'action' => 'view', $sousCategory->category->id]) : '' ?></td>

                <td class="actions" style="padding: 6px 0;">
                    <?= $this->Html->link(__('<i class="icon-eye-open"></i>'), ['action' => 'view', $sousCategory->id], ['title' => 'Visualiser', 'style' => 'margin: 0 2px', 'escape' => false ]) ?>
                    <?= $this->Html->link(__('<i class="icon-pencil"></i>'), ['action' => 'edit', $sousCategory->id], ['title' => 'Editer', 'style' => 'margin: 0 2px', 'escape' => false ]) ?>
                    <?= $this->Form->postLink(__('<i class="icon-trash"></i>'), ['action' => 'delete', $sousCategory->id], ['title' => 'Supprimer', 'style' => 'margin: 0 2px', 'escape' => false, 'confirm' => __('Êtes-vous sur de vouloir supprimer # {0}?', $sousCategory->id)]) ?>
                </td>

            </tr>
            <?php endforeach; ?>
        </tbody>
    </table>

    <p><?= $this->Paginator->counter(['format' => 'Page {{page}} sur {{pages}}']) ?></p>
    
    <div class="paging" style="color: black;">
    		<?= $this->Paginator->first('<< ' . __(''), ['class' => 'prev']) ?>
            <?= $this->Paginator->prev('< ' . __(''), ['class' => 'prev disabled']) ?>
            <?= $this->Paginator->numbers(['separator' => '']) ?>
            <?= $this->Paginator->next(__('') . ' >', ['class' => 'next disabled']) ?>
            <?= $this->Paginator->last(__('') . ' >>', ['class' => 'next']) ?>
    </div>

</div>

    	<div class="actions">
			<?php echo $this->element('menu') ?>
			<?php echo $this->element('menu_index', 
			[ 'pluralHumanName' => 'Sous-Catégories',
			'singularHumanName' => 'Sous-Catégorie' ]) ?>
		</div>