Download the PHP package wabisoft/craft-bonsai-twig without Composer

On this page you can find all versions of the php package wabisoft/craft-bonsai-twig. 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 craft-bonsai-twig

Twig Template Code Helper Plugin

Welcome to the Twig Template Code Helper Plugin README! This plugin is designed to streamline your Twig templating experience by loading code based on specific element types in Craft CMS 5.

Features

Usage Guide

Core Template Functions

  1. Item Templates

    • Function: itemTemplates
    • Usage: {{ itemTemplates({ entry }) }}
    • Description: Loops through nested entries.
    • Suggested Comment:
  2. Entry Templates

    • Function: entryTemplates
    • Usage: {{ entryTemplates({ entry }) }}
    • Description: Loads templates for core entry elements.
    • Suggested Comments:
  3. Category Templates

    • Function: categoryTemplates
    • Usage: {{ categoryTemplates({ entry }) }}
    • Description: Loads templates for category elements.
    • Suggested Comments:
  4. Matrix Templates
    • Function: matrixTemplates
    • Usage: {{ matrixTemplates({ matrix }) }}
    • Description: Loads templates for matrix rows.
    • Suggested Commment:

Advanced Matrix Additionally, you can set this up to handle additional parameters. The built-in on is "style" to easily change the visual of the block. To do so, you can feed the blocks individually like this

rather thank passing the entire "matrix" group in.

Parameters

Enhance your debugging with the following optional parameters in devMode:

Notes on Craft CMS 5

In Craft CMS 5, categories and matrix elements are now treated as entries and follow the entry model. This unification simplifies template handling and ensures consistency across different element types.

Integration with Craft 5 render()

Craft 5 introduces a convenient render() method for elements, enabling the rendering of elements directly within templates. By default, the render() function looks for templates in the _partials directory, using the element’s type and name.

Default Template Path

Using render() for Nested Matrix Blocks

You can utilize render() to manage nested matrix blocks effectively:

twig {{ itemTemplates({ entry }) }}


{{ matrixTemplates({ matrix }) }}

### Advanced Usage
Append URL paramters to the URL to render debug info while in devMode

?showPathParam=true&showHierarchyParam=true

All versions of craft-bonsai-twig with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2.0
craftcms/cms Version ^5.0.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 wabisoft/craft-bonsai-twig contains the following files

Loading the files please wait ....