Download the PHP package petercoles/themes without Composer

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

Themes for Laravel

SensioLabsInsight Scrutinizer Code Quality Code Coverage Build Status License

Introduction

This is far from being the only theme management package available for Laravel (see below). Each has its own approach. This one's point of uniqueness is its no-coding approach. Instead you simply install it, set config rules and the package uses those rules to determine which theme to use.

Other Laravel Theme Packages that you might want to consider

Installation

At the command line run

then add the service provider to the providers entry in your config/app.php file

Configuration

Publish the configuration file from the command line with

or if you only want to publish this package

The resulting themes config file has a single default setting that will leave your site untouched. To start controlling the themes used, see the next section ...

Creating Your Themes

By default this package will continue to use your views and assets in their default Laravel locations. To start to over-ride these defaults with context-based alternatives, first create a theme folder at the same level as your Laravel's resource folder. Inside that create a folder for one or more themes.

For example:

Within each theme place your config, asset and views files. For example:

Configs

Config files will be detected and loaded automatically. They will completely replace any files with the same name in the normal config folder, rather than overriding individual settings.

Assets

There is no automatic management of assets. Elixir is recommended, but any similar build system can be used to process, prepare and place them in you site's public folder. To avoid collisions, it's recommended that you place them in subfolders with the same name as the theme's folder, for example:

If you do so, then the theme_assets() and secure_theme_assets() helper functions are available for inserting links to the assets into view. For example the following will autodetect which theme is in use and point to the appropriate scripts file:

Views

Views are detected automatically. If your route, your controller or another view calls for a view that is present in your theme, that's the version that will be used, otherwise it will look for the view in the normal views hierarchy, and if it doesn't find it there either, the normal exception will be thrown. So if the current theme is "foo" then will look first for and if not found then for .

... one more thing

There's also a helper, to build the file path to the themes folder and, like other path helpers in Laravel will prepend that path to any received as a string parameter.

Setting Rules for Theme Selection

To control the selection of themes, you can rules to the themes config file. These rules follw the same syntax as Laravel's validation rules. The package will process each set of rules in turn and if a match is found will set the themes to the given value. For example the themes config:

will cause any route that has a subdomain of "admin" to use the template also named "adminV1". All other routes will use the template "siteV2".

It is also possible, even normal, to use several criteria in a single match status, with each separated by a pipe ("|"). For example:

The matcher works from the top of the config file and the first set where all the match criteria are met is the winning theme.

If no match criteria are provided for a theme, that is treated as a successful match (see the default in the last but one example).

Whitespace is automatically stripped from match statements, so feel free to lay them out however, you like ...

Currently supported matchers are:

dates

The rule must receive at least one date and match the server time against that date. If it receives a second date, as in the example above, then it will treat the two dates as the outers of an inclusive date range. dates must be in international format. It's likely that this will change to become more flexible in later versions.

domain

The rule will match if the FQDN is exactly the same as that given, so changes of subdomain or TLD will cause the match to fail. If you use different domain names in development, staging and production, you may wish to include several domain rules in a match group. Please not that it's likely that this behaviour will change to be a little more friendly in future versions of this package.

environment

The rule will match the paramter given against the value of Laravel's APP_ENV global variable. This is most commonly used as a supplementary criteria to safeguard against themes under development leaking out to a production environment.

http_scheme

Allows http routes to receive different theme to https routes. The rule takes http or https as its parameter.

subdomain

This rule allows just the subdomain to be matched.

url_segment

The rule currently receives a single parameter and compares it to the first segment in the route. It's another of those for which expansion and more flexiblity is planned, so use with care.

Roadmap

More matchers are planned including:

Some existing matchers will be reworked to make them more friendly. It is recommended that you not tie your project to the dev-master and instead target a specific branch. Breaking changes will be clearly stated in the (currently non-existent) change log and the package will use semantic versioning so that targetting tags such as "^0.1" or "^0" will not expose you to API changes.

Contributions

Contributions and suggestions are welcome. Code should be placed on a feature branch and include tests.


All versions of themes with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
illuminate/config Version ~5
illuminate/http Version ~5
illuminate/view Version ~5
nesbot/carbon Version ^1.21
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 petercoles/themes contains the following files

Loading the files please wait ....