Download the PHP package cloudbase/latte-helper without Composer

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

Latte Helper

Version 1.2.1 License GPL-3.0-or-later Coverage 54.55%

An unofficial helper package for rendering Latte templates in Symfony applications.

🚀 Installation

Then add the following to the imports section in your config/services.yaml:

You'll also need to add some configuration for your Latte controllers:

You don't need to add this for every single controller, this is just a reference to the directory where your controllers are stored. Add this definition for each directory containing Latte controllers. This does however mean that every controller inside that directory is expected to be an extension of AbstractLatteController controller.

🧩 Usage

This package provides an abstract controller to simplify rendering Latte templates in Symfony. To get started, extend AbstractLatteController and use renderTemplate():

By default, templates are loaded from your project’s /views directory. You can change this by setting the $templateDir property on your controller.

🏗️ Custom Template Directory

If you use a different directory, it’s recommended to create a base controller that others extend:

The example above renders /templates/frontend/index.latte.

$templateDir should always be relative to your project root.

💡 Template Variables

Every template automatically receives an $app variable - an instance of LatteAwareApplication.

This provides access to some common Symfony features (similar to the app variable in Twig):

⚙️ Using $app in Controllers

You can also access the same application instance within your controller:

🌐 Global Template Data

Need data available across multiple templates?

Override the globalData() method in your base controller:

All controllers inheriting from this class will have access to $myGlobal in addition to $app and local template variables.

🧩 Custom Latte Extensions

To register your own Latte extensions, create a config/latte.php file in your Symfony project.

This file should return an array of class names and their constructor arguments:

This allows you to use custom Latte tags, filters, and functions throughout your templates.


All versions of latte-helper with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
latte/latte Version ^3.0
symfony/http-foundation Version ^8.0
symfony/framework-bundle Version ^8.0
symfony/security-bundle Version ^8.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 cloudbase/latte-helper contains the following files

Loading the files please wait ...