Files
yii2/framework/views/_createTable.php
Robert Korulczyk 5a8c3d537b Enable phpdoc_summary rule in php-cs-fixer config (#14675)
* Enable `phpdoc_summary` rule in php-cs-fixer config.

* Fix case in "PHPDoc".
2017-08-21 11:19:35 +02:00

23 lines
607 B
PHP

<?php
/**
* Creates a call for the method `yii\db\Migration::createTable()`.
*/
/* @var $table string the name table */
/* @var $fields array the fields */
/* @var $foreignKeys array the foreign keys */
?> $this->createTable('<?= $table ?>', [
<?php foreach ($fields as $field):
if (empty($field['decorators'])): ?>
'<?= $field['property'] ?>',
<?php else: ?>
<?= "'{$field['property']}' => \$this->{$field['decorators']}" ?>,
<?php endif;
endforeach; ?>
]);
<?= $this->render('_addForeignKeys', [
'table' => $table,
'foreignKeys' => $foreignKeys,
]);