Package Data | |
---|---|
Maintainer Username: | pionl |
Maintainer Contact: | martin.kluska@imakers.cz (Martin Kluska) |
Package Create Date: | 2016-02-02 |
Package Last Update: | 2016-06-21 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-21 03:02:21 |
Package Statistics | |
---|---|
Total Downloads: | 59 |
Monthly Downloads: | 2 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 0 |
Total Open Issues: | 0 |
Without Crumbs
composer require pion/laravel-support-controllers
With Crumbs
composer require pion/laravel-support-controllers
composer require atorscho/crumbs 2.2
Adds a new set of protected functions for the current controller. Enables getting the controller name with the namespace without the controllers namespace (for custom namespace overide the "getControllersRootNamespace" method). Also you can get current url, controllers action string for URL and controllers URL for given action.
getCurrentActionForName($action);
getCurrentActionURL($action, $parameters = []);
getControllerName();
getCurrentFullURL();
Loads the URLTrait and enables creating a navigation for a resource controller (or any controller). Support creating current page link, current page link with a link to a list page (index page), models name and link to detail action (or edit and etc). Samples of url can be:
/sites - call the createNavigation() without title Result: list page
/sites/create - call the createNavigation("New page"); Result: list page -> New page
/sites/1/edit - call the createNavigation("Edit", $object); Result: list page -> name -> Edit
/sites/1/edit - model has no detail view, call the createNavigation("Edit", $object); Result: list page -> name
etc.
You can change some properties:
$listModelAction
the controllers action name for a list$detailModelAction
the controllers action name for the detail action (default is show, can be edit if not supported)$listTitle
the title for the listYou can handle some states when the createNavigation is triggered:
Triggered before adding a list navigation. Called only if list page is supported
Triggered before the model action is added (edit/show/etc)
Calls the addNavigation with list action
Calls the addNavigation with given url and the model names, method must return bool if the navigation was added.
Implements the Crumbs navigation with AbstractNavigationTrait trait