小编Dar*_*Lap的帖子

Pagination在Cakephp 3.x中排序

在cakephp 3.xi中找不到分页顺序

这是我的控制器:

//AgentsController.php
public function show()
{
    $agents = $this->Agents->find()
    $this->set('agents', $this->paginate($agents));
}
Run Code Online (Sandbox Code Playgroud)

这是我观点的一部分

//show.ctp
<!-- ....... -->
<table class="table table-striped">
   <thead>
      <tr>
        <th>
            <?php echo $this->Paginator->sort('full_name', 'Nome', array('escape' => false)); ?>
        </th>
        <th>
            <?php echo $this->Paginator->sort('username', 'Email', array('escape' => false)); ?>
        </th>
        <th>
            <?php echo $this->Paginator->sort('regions', 'Regioni', array('escape' => false)); ?>
        </th>
      </tr>
   </thead>
<!-- ....... -->
Run Code Online (Sandbox Code Playgroud)

哪里错了?

php cakephp cakephp-3.0

3
推荐指数
1
解决办法
6854
查看次数

使用cakephp 3.x设置class或div复选框表单

在CakePhp 3中,我有一个参数列表,我想在复选框中插入.我有这个代码

<?php
echo $this->Form->input('regions', [            
    'options'  => $regions,
    'value'    => Hash::extract($ad->toArray(), 'regions.{n}.id'),
    'class'    => 'col-xs-4',
    'type'     => 'select',
    'multiple' => 'checkbox',
    'label'    => false,
    'error'    => [
        'attributes' => ['class' => 'col-xs-12 error-message inline']
    ],        
]);   
?>   
Run Code Online (Sandbox Code Playgroud)

col-xs-4类没有出现.我也插了

'div' => 'col-xs-4'
Run Code Online (Sandbox Code Playgroud)

而不是上课.

我如何在每个复选框元素中插入一个类或div?

这是生成的html:

<div class="input select">
   <input type="hidden" name="regions" value="">
   <div class="checkbox"><label for="regions-1"><input type="checkbox" name="regions[]" value="1" id="regions-1">Abruzzo</label></div>
   <div class="checkbox"><label for="regions-2"><input type="checkbox" name="regions[]" value="2" id="regions-2">Basilicata</label></div>
   <div class="checkbox"><label for="regions-3"><input type="checkbox" name="regions[]" value="3" id="regions-3">Calabria</label></div>
   <div class="checkbox"><label for="regions-4"><input type="checkbox" name="regions[]" value="4" id="regions-4">Campania</label></div> …
Run Code Online (Sandbox Code Playgroud)

cakephp cakephp-3.0

2
推荐指数
1
解决办法
4142
查看次数

标签 统计

cakephp ×2

cakephp-3.0 ×2

php ×1