Download the PHP package mrmilu/alias_subpaths without Composer

On this page you can find all versions of the php package mrmilu/alias_subpaths. 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 alias_subpaths

Alias Subpaths

Drupal module to allow route aliases to recieve additional URL arguments. This module defines a new Drupal plugin system to allow developers which routes can recieve arguments.

Arguments are stored into a Drupal service alias_subpaths.context_manager. This service has 2 arrays (called bags) that stores raw arguments and the processed arguments, and it is available to use it anywhere.

Installation

To install this module as mrmilu module inside modules/mrmilu folder following composer commands should be executed:

Usage

There is an example into alias_subpath_node submodule that enable argument processor for node routes:

To create a new one we only have to create a plugin like this with the route_name that we want to enable, and implement getId() function to identify each route into your ArgumentResolverHandler.

ArgumentResolverHandler is a class that defines for each route id what argument types are allowed. By default, this module provides an argument resolver handler based on settings . php variables, but it can be changed for a custom one overriding this settings . php variable:

Ensure that your custom class implements ArgumentResolverHandlerInterface.

SettingsArgumentResolver

To set up what argument types are available for each route you have to override alias_subpaths__allowed_arguments_types variable in settings . php. This variable is an array like this:

If we use alias_subpaths_node module, route ids are segmented by bundle like this: entity:node:{bundle}.

Then you have to set up a new array variable called alias_subpaths__argument_resolver_class in settings . php to map each argument type with a class to resolve it which has to implement ArgumentResolverInterface:

If there is not defined an argument resolver, module provides one by default (DefaultArgumentResolver) that does nothing with received value.

Example

We have a content type called Filtered Page (filtered_page) and we want to enable alias subpaths for it. We want to be able to recieve nodes of type page or article, or taxonomy terms of vocabulary tags.

Also, we want to enable alias subpaths for taxonomy terms of vocabulary tags to process arguments of type node page.

To resolve arguments we want to use this fields for each argument type:

Once we have installed alias_subpaths_node and alias_subpaths_taxonomy_term modules, we have to fill this configuration on settings . php:

Then, you have to implement the argument resolvers in your proyect with your custom logic. For this example all of them are into a custom module called my_project and are like this:

IMPORTANT: Argument Resolvers should return NULL or FALSE if there is any error during argument resolve function like the entity doesn't exist. It is needed to show an HTTP 404 error


Usage of arguments

To illustrate this there is a submodule called alias_subpaths_examples that uses arguments into hook_preprocess_node:


All versions of alias_subpaths with dependencies

PHP Build Version
Package Version
No informations.
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 mrmilu/alias_subpaths contains the following files

Loading the files please wait ...