Download the PHP package wieni/wmcontroller without Composer

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

Wieni Controller

Latest Stable Version Total Downloads License

Adds support for bundle-specific controllers for Drupal 8 entities.

Why?

Installation

This package requires PHP 7.1 and Drupal 8 or higher. It can be installed using Composer:

You should also include the patch from #2638686 if you're getting early rendering errors in your controllers.

Configuration

Before you get started, make sure the theme or module that will hold your templates is configured to do so. Check the wmtwig documentation for more info.

Configuration is stored as service parameters. You can override these in a service YAML file defined in $settings['container_yamls'] or in the services.yml file of a (custom) module.

How does it work?

Creating controllers

Example

Rendering Twig templates

Using the ViewBuilder class, you can easily render Twig templates without having to mess with render arrays.

This module automatically resolves view builders to render arrays, so it's safe to return instances of this class in controllers.

The easiest way of building views is using the view method included in ViewBuilderTrait. Just pass the template name, any parameters and you're good to go.

The template name is the path to the template file, but with dots as path separators and without the file extension. Note that you can only use templates in the configured theme and path.

Example

Accessing the main entity

It's often useful to access the main entity of the current request, e.g. on canonical or edit routes. It has always been possible to access this entity by extracting it from the route parameters of the current route match, but the MainEntity service makes that easier.

Apart from having easier access to the entity, it's also possible to manually set the main entity of custom routes using the MainEntityTrait or the wmcontroller.main_entity service directly.

If the wmpage_cache module is installed, this main entity is also used to determine cachability metadata of the current request.

Changelog

All notable changes to this project will be documented in the CHANGELOG file.

Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.

License

Distributed under the MIT License. See the LICENSE file for more information.


All versions of wmcontroller with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
drupal/core Version ^9.1 || ^10 || ^11
wieni/wmtwig Version ^1.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 wieni/wmcontroller contains the following files

Loading the files please wait ....