/var/www/vhosts/ihelp.ro/httpdocs/plugins/AdminLTE/templates/bake/Template
NameSizeModeActions
add.twig7250644editdlrm
edit.twig7240644editdlrm
index.twig40180644editdlrm
view.twig63140644editdlrm
Edit: /var/www/vhosts/ihelp.ro/httpdocs/plugins/AdminLTE/templates/bake/Template/view.twig (6314B)
{# /** * 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 */ #} {% set associations = {'BelongsTo': [], 'HasOne': [], 'HasMany': [], 'BelongsToMany': []}|merge(associations) %} {% set fieldsData = Bake.getViewFieldsData(fields, schema, associations) %} {% set associationFields = fieldsData.associationFields %} {% set groupedFields = fieldsData.groupedFields %} {% set pK = '$' ~ singularVar ~ '->' ~ primaryKey[0] %}

{{ singularHumanName }}

{% if groupedFields['string'] %} {% for field in groupedFields['string'] %} {% if associationFields[field] %} {% set details = associationFields[field] %}
has('{{ details.property }}') ? $this->Html->link(${{ singularVar }}->{{ details.property }}->{{ details.displayField }}, ['controller' => '{{ details.controller }}', 'action' => 'view', ${{ singularVar }}->{{ details.property }}->{{ details.primaryKey[0] }}]) : '' ?>
{% else %}
{{ field }}) ?>
{% endif %} {% endfor %} {% endif %} {% if associations.HasOne %} {% for alias, details in associations.HasOne %}
has('{{ details.property }}') ? $this->Html->link(${{ singularVar }}->{{ details.property }}->{{ details.displayField }}, ['controller' => '{{ details.controller }}', 'action' => 'view', ${{ singularVar }}->{{ details.property }}->{{ details.primaryKey[0] }}]) : '' ?>
{% endfor %} {% endif %} {% if groupedFields.number %} {% for field in groupedFields.number %}
Number->format(${{ singularVar }}->{{ field }}) ?>
{% endfor %} {% endif %} {% if groupedFields.date %} {% for field in groupedFields.date %}
{{ field }}) ?>
{% endfor %} {% endif %} {% if groupedFields.boolean %} {% for field in groupedFields.boolean %}
{{ field }} ? __('Yes') : __('No'); ?>
{% endfor %} {% endif %}
{% if groupedFields.text %} {% for field in groupedFields.text %}

Text->autoParagraph(${{ singularVar }}->{{ field }}); ?>
{% endfor %} {% endif %} {% set relations = associations.BelongsToMany|merge(associations.HasMany) %} {% for alias, details in relations %} {% set otherSingularVar = alias|variable %} {% set otherPluralHumanName = details.controller|underscore|humanize %}

{{ details.property }})): ?> {% for field in details.fields %} {% endfor %} {{ details.property }} as ${{ otherSingularVar }}): ?> {% for field in details.fields %} {% endfor %} {% set otherPk = '$' ~ otherSingularVar ~ '->' ~ details.primaryKey[0] %}
{{ field }}) ?> Html->link(__('View'), ['controller' => '{{ details.controller }}', 'action' => 'view', {{ otherPk|raw }}], ['class'=>'btn btn-info btn-xs']) ?> Html->link(__('Edit'), ['controller' => '{{ details.controller }}', 'action' => 'edit', {{ otherPk|raw }}], ['class'=>'btn btn-warning btn-xs']) ?> Form->postLink(__('Delete'), ['controller' => '{{ details.controller }}', 'action' => 'delete', {{ otherPk|raw }}], ['confirm' => __('Are you sure you want to delete # {0}?', {{ otherPk|raw }}), 'class'=>'btn btn-danger btn-xs']) ?>
{% endfor %}