Download the PHP package frozzare/digster without Composer

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

Digster

Build Status No Maintenance Intended

Twig templates for WordPress

Digster it's a WordPress plugin that allows you to render Twig views with a few Twig globals.

It's easy to register your own composers.

Install

Example

Example of page.php

Example of page.twig

Configuration

Digster has a few WordPress filters, one is the config filter. Debug is turn on by default if WP_ENV equals development

Locations

A array with the locations of the views. By default the get_templates_directory() . '/views' is registered.

Twig environment options

Read about the options on the Twig site

auto_reload example

API functions

All functions that has digster_ prefix can also be called as a static method on \Frozzare\Digster\Digster class. Just replace digster_ with Digster::, make sure that you have in your code use Frozzare\Digster\Digster

Fetch view

Fetch the view in to a string.

Get the view instance

Every view in digster is a instance of the view class and this can be accessed.

Nested views

digster_view or view will return the view instance so you can use the nest method.

You can do the same with digster_render and digster_fetch

Register composer

With Digster you can register composer with wildcard template or a specified template.

This example is for post object, but Digster already have this global variable loaded.

You can also create a composer class that you can add with digster_composer. The only method that is required on a composer class is compose that takes a view argument.

Register custom filters

Since 1.7.1

Register custom functions

Since 1.7.1

Register custom globals

Since 1.7.1

Register extension

Register Twig extension classes with Digster.

Render a view

Render a view

Share data between views

You can either use digster_composer with * (wildcard) to share data between views or use digster_share. All shared that can be overwrite.

Twig filters

apply_filters

Apply filters to Twig output.

Excerpt

Get the post summary

Shortcodes

Run WordPress shortcodes on the text

wpautop

Append p tags to the text

Twig functions

Since 1.7.1 you can call esc_html__, esc_html_e, esc_attr__, esc_attr_e, esc_js, esc_textarea, esc_url and esc_url_raw with the same arguments as you should use in WordPress.

Call __

The same argument as WordPress's __.

Digster has full support for Twig i18n, read more about it.

Call _n

The same argument as WordPress's _n.

Digster has full support for Twig i18n, read more about it.

Call action

You can send more arguments to do action

Call apply_filters

Takes the same arguments as apply_filters

Call body_class

Call language_attributes

Call random function

You can send in more arguments to fn

Call wp_footer

Call wp_head

Call wp_title

Takes the same arguments as wp_title

Twig globals

post

post is global when get_the_ID() returns a id.

Twig i18n

Digster has full support for Twig i18n extensions. You don't have to do anything to enable it, just use it! It will load the theme text domain automatic. Don't forget to add it to your style.css.

Using Poedit? You should look at Twig Gettext Extractor! Digster will install Twig Gettext Extractor so you don't have to do it!

Cache

Look at Twig cache extension (Digster installs the package so you don't have to install it). Digster has a build in cache provider that uses the WordPress Object cache.

Coding style

You can check if your contribution passes the styleguide by installing PHP CodeSniffer and running the following in your project directory:

License

MIT © Fredrik Forsmo


All versions of digster with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.7
twig/twig Version ~1.0
asm89/twig-cache-extension Version ~1.0
frozzare/tank Version ~1.1.0
composer/installers Version ~1.0
twig/extensions Version ~1.0
umpirsky/twig-gettext-extractor 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 frozzare/digster contains the following files

Loading the files please wait ....