Navigation Generator
generate a google sitemap XML file
navigation-generator
Generate your main navigation on site with custom template and predefaulted friendly urls.
Required Laminas Components
- laminas/laminas-navigation
On-line Generator
Setup Instructions
- Ensure you have module called: %module% in your application.
- Copy and paste file contents of global.php into config/autload/global.php
- Inject content of 'view_manager' and 'router' into pre-existing sections in the module/%module%/config/module.config.php file.
- Optional Copy content of 'controllers'factories' to register new controller.
- Copy and paste file contents of layout.php into module/%module%/view/layout/layout.phtml. Make sure you paste it in the correct place of which you want to display the menu.
- Create a new folder: module/%module%/view/_shared/ and created in there a file called: menu.phtml. Copy the contents of the generated file from above.
- Optional Copy the new %name%MenuController into module/%module%/src/Controller/ folder.
- Optional Copy all the menu pages .phtml files into one folder called: 'module/%module%/view/%viewFolderName%/'.
Throubleshooting
Make sure your application contains all the required plugins from "Required Laminas Components" and "Required Laminas Kit Components".
You can learn how to add missing dependencies in this video:
You can learn how to add missing dependencies in this video:
Seelct "Include new controller code" checkbox to get related controller and view files to render pages.
Parameters
Param name | Type | Default value | Description |
---|---|---|---|
name | text | NULL | Sets a navigation name |
module | text | NULL | Sets a module name |
items | array | [] | Sets navigation's elements |
include_controller | checkbox | Includes related controllers code and views |
CLI Usage
"vendor/bin/laminas.bat" mvc:navigation --items=<element1> --items=<element2> --include_controller=true --module=<moduleName> <name>
Example Usage
"vendor/bin/laminas.bat" mvc:navigation --items=home --items=setup --items=contact --include_controller=true --module=Application Primary