Loading...
Loading...

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

  1. laminas/laminas-navigation

On-line Generator

Setup Instructions

  1. Ensure you have module called: %module% in your application.
  2. Copy and paste file contents of global.php into config/autload/global.php
  3. Inject content of 'view_manager' and 'router' into pre-existing sections in the module/%module%/config/module.config.php file.
  4. Optional Copy content of 'controllers'factories' to register new controller.
  5. 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.
  6. 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.
  7. Optional Copy the new %name%MenuController into module/%module%/src/Controller/ folder.
  8. 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:
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

Learn more with Laminas Book:

Laminas MVC: the most innovative framework in PHP - get a book on Amazon

Need help? Checkout our setup page, video tutorials or ask questions on our forum!

Help Tutorials Forum
TOP