Download the PHP package miko/laravel-latte without Composer

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

Laravel Latte

Extends the Laravel framework with the templating engine Latte

Installation

Then the templating engine is used according to the file extension:

Configuration

Publish config file into config/latte.php:

Follow the instructions in the config file.

Extension

See https://latte.nette.org/tags

And additional:

Filter nl2br (bool $xhtml = null)

Default rendering as xhtml or html can be configured in the config file.

Tags {link} and n:href

Similar to tags in Nette except that the separator berween controller and method is not : but @ and the default method is not default but index according to the Laravel conventions. Basically this is a simplified call to Laravel's action() helper when there is no need to write the entire FQCN and the word Controller. In addition, it is possible to use the keyword this for the current action - then there is no need to write unchanged parameters.

(expand) - the equivalent of ...$arr operator https://latte.nette.org/en/syntax#toc-a-window-into-history

Usage of this

route:

template:

At address mysite.com/users/permissions/1/2 generates link mysite.com/users/permissions/1/2?sort=date

Tags {asset} and n:src

Adds the m parameter to the URL with the timestamp of the last file change. Every time the file is changed, it will be reloaded and there is no need to clear the browser cache:

Tags {csrf} and {method}

Generate hidden inputs _token and _method in form. See Preventing CSRF Requests and Form Method Spoofing. Rendering as xhtml or html can be configured in the config file.

Tags {livewire}, {livewireStyles}, {livewireScripts} a {livewireScriptConfig}

🧪 Experimental
Tags for Livewire. They are only available if livewire is implemented.

Since Livewire renders its templates itself, the template can be a latte or a blade file.

⚠️ WARNING: if the component view is a latte file and the default layout is set in config (latte.layout), the component view must have {layout none} at the beginning. Otherwise, Latte engine will try to render the layout again for this component.

resources/views/livewire/component-name.latte:

Translation {_}

Laravel provides functions __() and trans() respectively, see retrieving translation strings, and trans_choice(), see Pluralization. The tag {_} can handle both, it depends on the second parameter, whether it is an integer or an array.

Above is equivalent to Laravel functions:

If you want to implement Latte\Essential\TranslatorExtension as described in Latte doc, you can do so in ServiceProvider e.g. like this:

Why is it not implemented by default?

Components {x}

An object implementing Miko\LaravelLatte\IComponent can be rendered in template:

View:

Root namespace of components is set in config (latte.components_namespace) and is App\View\Components by default.

⚠️ WARNING: if the default layout is set in config (latte.layout), the component view must have {layout none} at the beginning. Otherwise, Latte engine will try to render the layout again for this component.


All versions of laravel-latte with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
illuminate/view Version ^11.0
latte/latte Version ^3.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 miko/laravel-latte contains the following files

Loading the files please wait ....