diff --git a/src/Template/Bake/default/views/form.ctp b/src/Template/Bake/default/views/form.ctp index 1b03b1f0e3e..6bdd1fe1f8c 100644 --- a/src/Template/Bake/default/views/form.ctp +++ b/src/Template/Bake/default/views/form.ctp @@ -13,8 +13,30 @@ * @license http://www.opensource.org/licenses/mit-license.php MIT License */ use Cake\Utility\Inflector; + ?> -
+
+

" ?>

+ +
+
Form->create(\${$singularVar}) ?>\n" ?>
", Inflector::humanize($action), $singularHumanName) ?> @@ -45,24 +67,3 @@ use Cake\Utility\Inflector; echo "Form->end() ?>\n"; ?>
-
-

" ?>

- -
diff --git a/src/Template/Bake/default/views/index.ctp b/src/Template/Bake/default/views/index.ctp index 64468e7d38c..4ce07f79eff 100644 --- a/src/Template/Bake/default/views/index.ctp +++ b/src/Template/Bake/default/views/index.ctp @@ -13,73 +13,84 @@ * @license http://www.opensource.org/licenses/mit-license.php MIT License */ use Cake\Utility\Inflector; + +$fields = collection($fields) + ->filter(function($field) use ($schema) { + return !in_array($schema->columnType($field), ['binary', 'text']); + }) + ->take(7); +?> +
+

"; ?>

+ +
+
+ - + - + + + \n"; - echo "\t\n"; + echo "\t\t\n"; foreach ($fields as $field) { $isKey = false; if (!empty($associations['BelongsTo'])) { foreach ($associations['BelongsTo'] as $alias => $details) { if ($field === $details['foreignKey']) { $isKey = true; - echo "\t\t\n"; + echo "\t\t\t\n"; break; } } } if ($isKey !== true) { - echo "\t\t\n"; + echo "\t\t\t\n"; } } $pk = "\${$singularVar}->{$primaryKey[0]}"; - echo "\t\t\n"; - echo "\t\n"; + echo "\t\t\t\n"; + echo "\t\t\n"; echo "\t\n"; ?> +
Paginator->sort('{$field}') ?>"; ?>Paginator->sort('{$field}') ?>"; ?> "; ?>"; ?>
\n\t\t\thas('{$details['property']}') ? \$this->Html->link(\${$singularVar}->{$details['property']}->{$details['displayField']}, ['controller' => '{$details['controller']}', 'action' => 'view', \${$singularVar}->{$details['property']}->{$details['primaryKey'][0]}]) : '' ?>\n\t\t\n\t\t\t\thas('{$details['property']}') ? \$this->Html->link(\${$singularVar}->{$details['property']}->{$details['displayField']}, ['controller' => '{$details['controller']}', 'action' => 'view', \${$singularVar}->{$details['property']}->{$details['primaryKey'][0]}]) : '' ?>\n\t\t\t{$field}) ?> {$field}) ?> \n"; - echo "\t\t\tHtml->link(__('View'), ['action' => 'view', {$pk}]) ?>\n"; - echo "\t\t\tHtml->link(__('Edit'), ['action' => 'edit', {$pk}]) ?>\n"; - echo "\t\t\tForm->postLink(__('Delete'), ['action' => 'delete', {$pk}], ['confirm' => __('Are you sure you want to delete # {0}?', {$pk})]) ?>\n"; - echo "\t\t
\n"; + echo "\t\t\t\tHtml->link(__('View'), ['action' => 'view', {$pk}]) ?>\n"; + echo "\t\t\t\tHtml->link(__('Edit'), ['action' => 'edit', {$pk}]) ?>\n"; + echo "\t\t\t\tForm->postLink(__('Delete'), ['action' => 'delete', {$pk}], ['confirm' => __('Are you sure you want to delete # {0}?', {$pk})]) ?>\n"; + echo "\t\t\t
-

Paginator->counter() ?>"; ?>

- -
-
-

"; ?>

- +
+
    + Paginator->prev('< ' . __('previous'));\n"; + echo "\t\t\techo \$this->Paginator->numbers();\n"; + echo "\t\t\techo \$this->Paginator->next(__('next') . ' >');\n"; + echo "\t\t?>\n"; + ?> +
+

Paginator->counter() ?>"; ?>

+