Skip to content

Commit

Permalink
udpate docs for new getMenu builder class #1045
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Oct 24, 2016
1 parent 73b632d commit aa87342
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
5 changes: 2 additions & 3 deletions core/console/commands/CrudController.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,9 @@ public function actionCreate()

$getMenu = 'public function getMenu()
{
return $this->node(\''.Inflector::humanize($modelName).'\', \'extension\') // instead of extension, choose icon from https://design.google.com/icons/
return (new \luya\admin\components\AdminMenuBuilder($this))->node(\''.Inflector::humanize($modelName).'\', \'extension\') // instead of extension and label, choose icon from https://design.google.com/icons/
->group(\'GROUP\')
->itemApi(\''.Inflector::humanize($modelName).'\', \''.$data['api']['route'].'\', \'label\', \''.$apiEndpoint.'\') // instead of label, choose icon from https://design.google.com/icons/
->menu();
->itemApi(\''.Inflector::humanize($modelName).'\', \''.$data['api']['route'].'\', \'label\', \''.$apiEndpoint.'\');
}
';

Expand Down
5 changes: 2 additions & 3 deletions docs/guide1.0/app-admin-module-ngrest.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,10 @@ The store the permission informations of your newly created ngrest crud you have
```php
public function getMenu()
{
return $this
return (new \luya\admin\components\AdminMenuBuilder($this))
->node("Team Admin", "account")
->group("Manager")
->itemApi("Members", "teamadmin-member-index", "extension", "api-teamadmin-member")
->menu();
->itemApi("Members", "teamadmin-member-index", "extension", "api-teamadmin-member");
}
```

Expand Down
10 changes: 4 additions & 6 deletions docs/guide1.0/app-admin-module-permission.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ Custom Menu-Route
```php
public function getMenu()
{
return $this
return (new \luya\admin\components\AdminMenuBuilder($this))
->node("My Admin Module", "materialize-css-icon")
->group("Verwalten")
->itemRoute("Stats", "myadminmodule/stats/index", "materialize-css-icon")
->itemRoute("Export)", "myadminmodule/stats/export", "materialize-css-icon")
->menu();
->itemRoute("Export)", "myadminmodule/stats/export", "materialize-css-icon");
}
```

Expand All @@ -24,14 +23,13 @@ Menu-Api
```php
public function getMenu()
{
return $this
return (new \luya\admin\components\AdminMenuBuilder($this))
->node('Administration', 'mdi-navigation-apps')
->group('Zugriff')
->itemApi('Benutzer', 'admin-user-index', 'mdi-action-account-circle', 'api-admin-user')
->itemApi('Gruppen', 'admin-group-index', 'mdi-action-account-child', 'api-admin-group')
->group('System')
->itemApi('Sprachen', 'admin-lang-index', 'mdi-action-language', 'api-admin-lang')
->menu();
->itemApi('Sprachen', 'admin-lang-index', 'mdi-action-language', 'api-admin-lang');
}
```

Expand Down

0 comments on commit aa87342

Please sign in to comment.