PHP Classes

File: src/templates/fixture_data.php

Recommend this page to a friend!
  Classes of Insolita   Yii2 Fixture ii   src/templates/fixture_data.php   Download  
File: src/templates/fixture_data.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Yii2 Fixture ii
Generate fixture code files from templates scripts
Author: By
Last change:
Date: 2 months ago
Size: 545 bytes
 

Contents

Class file image Download
<?php
/**
 * The following variables are available in this view:
 */
/**
 * @var array $data
 * @var string $tableCaption
 * @var \insolita\fixturegii\generators\DataGenerator $generator
 */
echo "<?php\n";
?>
return [
<?php foreach($data as $index=>$row):?>
'<?=$tableCaption.($index+1)?>' => [
    <?php foreach($row as $name=>$val):?>
'<?=$name?>' => '<?= addslashes($val);?>',
    <?php endforeach;?>
],
<?php endforeach;?>
];