Skip to content

Commit

Permalink
Update new version
Browse files Browse the repository at this point in the history
  • Loading branch information
mesour committed May 1, 2016
1 parent f19722b commit 0dc9338
Show file tree
Hide file tree
Showing 2 changed files with 394 additions and 200 deletions.
15 changes: 10 additions & 5 deletions app/Http/Controllers/Front/HomepageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ public function __construct(ApplicationManager $applicationManager)
['id' => '20', 'action' => '0', 'group_id' => '3', 'name' => 'John', 'surname' => 'Petterson', 'email' => '[email protected]', 'last_login' => '2014-10-10 10:10:10', 'amount' => '2500', 'avatar' => 'avatar/20.png', 'sort' => '190', 'timestamp' => '1418255275']
];

//create relations
$groups = [
['id' => '2', 'name' => 'Group 2'],
['id' => '1', 'name' => 'Group 1'],
['id' => '3', 'name' => 'Group 3'],
['id' => '2', 'name' => 'Group 2', 'type' => 'first'],
['id' => '1', 'name' => 'Group 1', 'type' => 'second'],
['id' => '3', 'name' => 'Group 3', 'type' => 'first'],
];

// create source
Expand All @@ -56,14 +57,18 @@ public function __construct(ApplicationManager $applicationManager)
$groupStructure = $source->addTableToStructure('group', 'id');
$groupStructure->addNumber('id');
$groupStructure->addText('name');
$groupStructure->addEnum('type')
->addValue('first')
->addValue('second');

$dataStrucutre = $source->getDataStructure();

$source->joinField('group', 'group_id', 'name', 'group_name');

$dataStrucutre->addDate('last_login');
$dataStrucutre->addDate('timestamp');
$dataStrucutre->addOneToOne('group_name', 'group', 'name');

$dataStrucutre->addManyToOne('group', 'group', 'group_id', '{name} ({type})');

$grid->setSource($source);

Expand Down Expand Up @@ -135,7 +140,7 @@ public function __construct(ApplicationManager $applicationManager)

$grid->addText('email', 'E-mail');

$grid->addText('group_name', 'Group');
$grid->addText('group', 'Group');

$grid->addNumber('amount', 'Amount')
->setUnit('CZK');
Expand Down
Loading

0 comments on commit 0dc9338

Please sign in to comment.