Download the PHP package stellarwp/templates without Composer

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

StellarWP Templates

Tests Static Analysis

A library for including templates in a WordPress plugin that users can choose to override within a specific directory of a theme or child theme.

Installation

It's recommended that you install Templates as a project dependency via Composer:

We actually recommend that this library gets included in your project using Strauss.

Luckily, adding Strauss to your composer.json is only slightly more complicated than adding a typical dependency, so checkout our strauss docs.

Notes on examples

Since the recommendation is to use Strauss to prefix this library's namespaces, all examples will be using the Boomshakalaka namespace prefix.

Configuration

This library requires some configuration before its features can be used. The configuration is done via the Config class.

Once you've configured the library, extend the Template class to define the location of templates for your plugin.

With your class extension, manually define where the base folder for templates is in the class' plugin_path property. Here is an example of what that class may look like:

Once you've done that, you can instantiate your class instance and define a few other settings:

With the template class set up, calling $template->template('template-file') will include the template looking for it in:

  1. child theme

  2. parent theme

  3. the plugin

All versions of templates with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
stellarwp/arrays Version ^1.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 stellarwp/templates contains the following files

Loading the files please wait ....