Download the PHP package mindgruve/mg-press without Composer

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

MGPress Starter WordPress Theme

Welcome to MG Press, a WordPress starter theme that uses the Timber plugin to add support for Twig template files. It allows developers to make use of the MVC pattern (especially the View-Controller) while creating a WordPress theme, separating the business logic from the view logic.

Installing the Theme

Install this theme as you would any other, and be sure the Timber plugin is activated. But hey, let's break it down into some bullets:

  1. Make sure you have installed the plugin for the Timber Library (and Advanced Custom Fields - they play quite nicely together).
  2. Download the zip for this theme (or clone it) and move it to wp-content/themes in your WordPress installation.
  3. Activate the theme in Appearance > Themes.
  4. Do your thing! And read the docs.

What's here?

*.php are the normal WordPress PHP template files that correspond to the template hierarchy, such as index.php and single.php. These files act as the controllers: the system (WordPress) determines which file to load based on the URL; runs any necessary business logic; adds any data for the view layer to the $context variable; determines which view to render; renders the view by passing it the $context variable and sending the output to the browser. At the end of each PHP template, you'll notice a Timber::render() function whose first parameter is the Twig file(s) and the second parameter is the $context variable.

views/ contains all of your Twig templates. The PHP template files determine which view to render.

assets/ contains static assets, such as CSS, JavaScript, images, fonts, static HTML, etc.

lib/ is where we keep the PHP library for MGPress features, like handling comments or asset management. Unless you know what you are doing it's probably best to leave these alone.

custom/ contains custom PHP code for this theme - it serves the same function as WordPress's default functions.php. PHP files in this directory will be autoloaded by the functions.php file. You can also override classes from lib/ here.

controllers/ contains custom controllers for additional business logic that the PHP template files may not provide. Available for Post Type list and detail views and Taxonomy List views by adding a file named list-{post-type}.php, detail-{post-type}.php or list-taxonomy-{taxonomy-slug}.php respectively. An example use case would be to modify the Timber\PostQuery in a list view to change the listing order or limit.

models/ contains autoloaded classes that register Custom Post Types. Each Custom Post Type should have its own class that registers the post type and any related taxonomies and optionally defines custom properties, although it is usually easier to define properties via the Advanced Custom Fields plugin.

lang/ location for the .mo translation files, specified by load_theme_textdomain() in lib/site.php. (optional)

How Does This Work?

If you were expecting a normal WordPress theme, this may look a little strange - don't worry, it's actually easier to work with WordPress this way. Why? First of all, it separates the business logic from the presentation layer. Also, you get to use Twig. And - you don't have to work with The Loop.

Example 1

In your WordPress Settings > Reading section you have the Posts Page set to /blog. When a visitor visits /blog, WordPress uses its template hierarchy to load the archive.php file. Inside the archive.php file is logic that creates a prioritized list of Twig templates from the views/list/ directory to try to load, depending on the type of archive. In this case, it's a basic blog listing page, so views/list/post.twig has the highest priority.

As it happens, views/list/post.twig exists, so Timber passes the data ($context) to the template and renders it. The views/list/post.twig template defines the content block, which contains presentation logic that loops over the posts variable (from $context) and renders summary template includes from views/summary/post.twig. The views/list/post.twig template also extends the views/layout/full-width.twig template.

The views/layout/full-width.twig template applies structural markup for the page layout, displays the content block, defines the layout block, and extends the views/base.twig template. The views/base.twig template applies the base HTML document structure, such as the <html> and <body> tags, includes the views/include/header.twig and views/include/footer.twig snippets, and displays the layout block. Since views/base.twig doesn't extend any templates, the rendering is complete and the output is sent to the browser.

Example 2

Your website has a Custom Post Type called Products under the path /products. When a visitor visits a single product page at /products/product-1 WordPress uses the template hierarchy to load the single.php file. That file creates a prioritized list of Twig templates from the views/detail/ directory to try to load. The first template in the list follows the format "{POST-TYPE}-{SLUG}.twig", so it becomes views/detail/product-product-1.twig. This template does not exist, so it tries the next one, views/detail/product.twig. This one exists, so single.php passes the template the data ($context) and renders the view.

The views/detail/product.twig displays the content of Product 1 and extends the views/layout/left-sidebar.twig template. The views/layout/left-sidebar.twig template applies structural markup for the page layout - including rendering a dynamic sidebar in the left column - and extends the views/base.twig template, which in turn provides HTML document structural markup, the header and footer, etc. which is sent to the browser.

View Hierarchy

When choosing which Twig template to render, the system closely follows the default WordPress template hierarchy, with some modifications:

Custom Twig Extensions

In addition to the standard Twig API, the following custom features are available to use in the templates.

Functions

Asset Management

add_stylesheet()

Add Stylesheet to HTML Output.

add_style()

Add Style to HTML Output.

add_script_file()

Add Script File to HTML Output.

add_script()

Add Script to HTML Output.

localize_script()

Localize Script.

Comments

can_comment()

Check if user can comment on a Post or Comment.

get_comments()

Get list of child comments from Post.

next_comments_link()

Create link for next comments.

previous_comments_link()

Create link for previous comments.

Filters

At this time there are no additional custom filters.

Other Resources

The main Timber Wiki is super great, so reference those often. Also, check out these articles and projects for more info:


All versions of mg-press with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
wordpress Version 4.3.1
fancyguy/webroot-installer Version 1.0.0
symfony/filesystem Version ~2.7
symfony/finder Version ~2.7
symfony/yaml Version ~2.7
jarednova/timber Version ~0.20
filp/whoops Version 1.1.7
dannyvankooten/php-router Version 1.1.0-alpha
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 mindgruve/mg-press contains the following files

Loading the files please wait ....