-
Notifications
You must be signed in to change notification settings - Fork 109
Description
Segue código corrigido.
{#
/**
- CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
- Licensed under The MIT License
- For full copyright and license information, please see the LICENSE.txt
- Redistributions of files must retain the above copyright notice.
- @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
- @link http://cakephp.org CakePHP(tm) Project
- @SInCE 2.0.0
- @license http://www.opensource.org/licenses/mit-license.php MIT License
- Colaboração: jranesio@hotmail.com
*/
#}
{% set fields = Bake.filterFields(fields, schema, modelObject, indexColumns, ['binary', 'text']) %}
{{ pluralHumanName }}
<div class="pull-right"><?php echo $this->Html->link(__('New'), ['action' => 'add'], ['class'=>'btn btn-success btn-xs']) ?></div>
<div class="pull-right"><?php echo $this->Html->link(__('New'), ['action' => 'add'], ['class'=>'btn btn-success btn-xs']) ?></div>
<div class="box-tools">
<form action="<?php echo $this->Url->build(); ?>" method="POST">
<div class="input-group input-group-sm" style="width: 150px;">
<input type="text" name="table_search" class="form-control pull-right" placeholder="<?php echo __('Search'); ?>">
<div class="input-group-btn">
<button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
</div>
</div>
</form>
</div>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive no-padding">
<table class="table table-hover">
<thead>
<tr>
{% for field in fields %}
Paginator->sort('{{ field }}') ?>
{% endfor %}
{% for field in fields %}
{% set isKey = false %}
{% if associations.BelongsTo %}
{% for alias, details in associations.BelongsTo|filter((details) => field == details.foreignKey) %}
{% set isKey = true %}
has('{{ details.property }}') ?
{% endfor %}
{% endif %}
{% if isKey is not same as(true) %}
{% set columnData = Bake.columnData(field, schema) %}
{% if columnData.type not in ['integer', 'float', 'decimal', 'biginteger', 'smallinteger', 'tinyinteger'] %}
{{ field }}) ?>
{% else %}
Number->format(${{ singularVar }}->{{ field }}) ?>
{% endif %}
{% endif %}
{% endfor %}
{% set pk = '$' ~ singularVar ~ '->' ~ primaryKey[0] %}
Html->link(__('View'), ['action' => 'view', {{ pk|raw }}], ['class'=>'btn btn-info btn-xs']) ?>
Html->link(__('Edit'), ['action' => 'edit', {{ pk|raw }}], ['class'=>'btn btn-warning btn-xs']) ?>
Form->postLink(__('Delete'), ['action' => 'delete', {{ pk|raw }}], ['confirm' => __('Are you sure you want to delete # {0}?', {{ pk|raw }}), 'class'=>'btn btn-danger btn-xs']) ?>