Download the PHP package noraziz/ci4-twiggy without Composer

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

CI4-Twiggy - Twig template engine implementation for CodeIgniter 4

This library is for Codeigniter 4, forked from twiggy. But, some development reference come from ss-twig & raizdev.

Twiggy is not just a simple implementation of Twig template engine for CodeIgniter. It supports themes, layouts, templates for regular apps and also for apps that use modular support, see: Code Modules.

It is supposed to make life easier for developing and maitaining CodeIgniter applications where themes and nicely structured templates are necessary.

Why Should I Care?

For some reason, the original twiggy library is moved to new structure so you can add this library to your projects using composer. Twig by itself is a very powerful and flexible templating system but with CodeIgniter it is even cooler! With Twiggy you can separately set the theme, layout and template for each page. What is even more interesting, this does not replace CodeIgniter's default Views, so you can still load views as such: $this->load->view().

Demo

Visit our demo repository github.

Our wiki is coming soon.

Features:

Default Functions:

Requirements

Installation

With Composer

$ cd /path/to/codeigniter/
$ composer require noraziz/ci4-twiggy

Usage

Set up dir structure

  1. Create a directory structure:

    NOTE: {APPPATH} is the folder where all your controllers, models and other neat stuff is placed. By default that folder is called app. Themes directory can also inside your module.

  2. Create a default layout index.html.twig and place it in _layouts folder:

  3. Create a default template file index.html.twig at the root of default theme folder:

  4. You should end up with a structure like this:

Initialize Twiggy

You must maually initialize twiggy engine.

$twiggy = new \noraziz\ci4twiggy\Twiggy();
$twiggy->init(__CLASS__);

Display the template

Render Twig template and output to browser:

$twiggy->display();

What's next?

In the example above we only displayed the default template and layout. Obviously, you can create as many layouts and templates as you want. For example, create a new template file page_welcome.html.twig and load it before sending the output to the browser.

$twiggy->layout('layout_model_1');
$twiggy->template('page_welcome');

//or using chaining
$twiggy->layout('layout_model_1')->template('page_welcome');

Notice that you only need to specify the name of the template (without the extension *.html.twig).

References

Documentation

@TODO


All versions of ci4-twiggy with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3.0
twig/twig Version ^3.3.8
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 noraziz/ci4-twiggy contains the following files

Loading the files please wait ....