Download the PHP package itcig/sagecontroller without Composer

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

Controller

WordPress package to enable a controller when using Timber/Twig with Sage 9. This also requires heavy modification of Sage 9 to use.

Installation

Composer:

Please note that Controller is no longer an mu-plugin and is now a Composer theme depedency.

Browse into the Sage theme directory and run;

Requirements:

Setup

By default, create folder app/Controllers/ within your theme directory.

Alternatively, you can define a custom path using the filter below within your themes resources/functions.php file;

The controller will autoload PHP files within the above path and its subdirectories.

Usage

Creating a basic Controller:

Examples:

The following example will expose $images to resources/views/single.twig

app/controllers/Single.php

resources/views/single.twig

Creating Components;

You can also create reusable components and include them in a view using PHP traits.

app/controllers/partials/Images.php

You can now include the Images trait into any view to pass on variable $images;

app/controllers/Single.php

Using Static Methods;

You can use static methods as a pass-thru method that returns content from your controller.

This is useful if you are within the loop and want to return data for each post item individually by passing in a $post_id.

app/controllers/Archive.php

resources/views/archive.php

Inheriting the Tree/Heirarchy;

By default, each Controller overrides its template heirarchy depending on the specificity of the Controller (the same way WordPress templates work).

You can inherit the data from less specific Controllers in the heirarchy by implementing the Tree.

For example, the following app/controllers/Single.php example will inherit methods from app/controllers/Singular.php;

app/controllers/Single.php

If you prefer you can also do this;

You can override a app/Controllers/Singular.php method by declaring the same method name in app/Controllers/Single.php;

Creating Global Properties;

Methods created in app/Controllers/App.php will be inherited by all views and can not be disabled as resources/views/layouts/app.php extends all views.

app/Controllers/App.php

Disable Option;

Twig Debugging;

Coming soon

Updates

Composer:

WordPress:

Includes support for github-updater to keep track on updates through the WordPress backend.

Special Thanks


All versions of sagecontroller with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
composer/installers Version ^1.12
symfony/yaml Version ^3.2
brain/hierarchy Version ^2.3
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 itcig/sagecontroller contains the following files

Loading the files please wait ....