Download the PHP package becklyn/route-tree-bundle without Composer

On this page you can find all versions of the php package becklyn/route-tree-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package route-tree-bundle

BecklynRouteTreeBundle

Adds a simple implementation for an automatic generation of a route tree to build a menu.

Installation

Install the bundle via packagist:

Load the bundle in your app/AppKernel.php:

Defining The Route Tree Nodes

You add elements to the tree by setting the options of the routes:

Path Options

parent must be set. Also all referenced parent-routes need to exist.

Priority

All child nodes of all nodes are sorted by descending priority.

Hidden

All items are automatically hidden, if they have no title set (or if the security expression evaluates to false).

Parameters

The parameters can define default values for parameters:

If you do not define a value, the parameter is looked up in the request attributes of the current request. If it doesn't find anything there, 1 is used.

Security

Every node can have a custom security expression, that is evaluated when printing the tree. All nodes where the security expression evaluates to false are automatically hidden (including all their child nodes).

If no explicit security expression is given, the builder tries to infer the expression from the linked controller by combining @IsGranted() and @Security() annotations from the action method and the controller class. If @IsGranted() is used with the subject attribute, nothing is infered.

Extra Parameters

You can define additional parameters, that can be used in the menu template. All path options that are not recognized (see "Path Options") are automatically added as extra parameters.

These extra parameters are available in the template under the extra property:

Error Cases

If the page tree is invalid a InvalidRouteTreeException is thrown, on the first construction of the page tree.

Short Syntax

In simple cases, the config can be simplified to:

Rendering the Route Tree

There is an automatic menu builder, that you can just use in the templates:

The first parameter is the parent node of which the menu should be used. The second (optional) argument are the KnpMenu render options.

Getting The Route Tree

You can inject the service Becklyn\RouteTreeBundle\Tree\RouteTree and use it to retrieve a node:

The return value is a Becklyn\RouteTreeBundle\Node\Node.


All versions of route-tree-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
becklyn/menu Version ^1.1.2 || ^2.0 || dev-legacy_support
symfony/cache Version ^4.3 || ^5.0
symfony/http-foundation Version ^4.3 || ^5.0
symfony/http-kernel Version ^4.3 || ^5.0
symfony/routing Version ^4.3 || ^5.0
twig/twig Version ^2.11 || ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package becklyn/route-tree-bundle contains the following files

Loading the files please wait ....