PHPackages                             cleatsquad/magento-smarty - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. cleatsquad/magento-smarty

ArchivedMagento2-module[Templating &amp; Views](/categories/templating)

cleatsquad/magento-smarty
=========================

Smarty template engine for Magento 2

1.0.0(4y ago)14MITPHP

Since Nov 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/CleatSquad/Magento2-Smarty)[ Packagist](https://packagist.org/packages/cleatsquad/magento-smarty)[ RSS](/packages/cleatsquad-magento-smarty/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (1)Used By (0)

CleatSquad Magento 2 Smarty
===========================

[](#cleatsquad-magento-2-smarty)

[![Packagist Downloads](https://camo.githubusercontent.com/72134d5f5292a04652ea588444679ef12d8e46ba515aaa708780841a4e6cc270/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f636c65617473717561642f6d6167656e746f322d736d617274793f636f6c6f723d626c7565)](https://packagist.org/packages/cleatsquad/magento2-smarty/stats)[![Packagist Version](https://camo.githubusercontent.com/2c1fdf39ac006ec31a830da23132bb942b33c44a167867e1559547c9dc279502/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c65617473717561642f6d6167656e746f322d736d617274793f636f6c6f723d626c7565)](https://packagist.org/packages/cleatsquad/magento2-smarty)[![Packagist License](https://camo.githubusercontent.com/2766faaf13f3091c60bb998a9fbffcf4f59f4ea888676f10aefd8c7262615ffd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636c65617473717561642f6d6167656e746f322d736d61727479)](https://github.com/cleatsquad/magento2-smarty/blob/main/LICENSE)

Magento Version Support
-----------------------

[](#magento-version-support)

[![Magento 2.4.6 and above](https://camo.githubusercontent.com/7839d74abe80987cfce039d4d8a55fbd32d29fb88fa1ccfffc973e42e0191dcc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6167656e746f2d322e34253230616e6425323061626f76652d627269676874677265656e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/7839d74abe80987cfce039d4d8a55fbd32d29fb88fa1ccfffc973e42e0191dcc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6167656e746f2d322e34253230616e6425323061626f76652d627269676874677265656e2e7376673f7374796c653d666c6174)

Purpose
-------

[](#purpose)

`CleatSquad_Smarty` is a Magento 2 module is an integration of the [Smarty](https://www.smarty.net/) template engine in Magento2. To use this package you need to write your Magento2 module, or you can write all your template files in Smarty. This template engine is intended to be used in addition to the `.tpl` files.

Getting Started
---------------

[](#getting-started)

This module is intended to be installed via [Composer](https://getcomposer.org/). To add it to your Magento 2 project, follow these steps:

### Installation

[](#installation)

1. **Download the package**

    ```
    composer require cleatsquad/magento2-smarty
    ```
2. **Enable the module**

    ```
    ./bin/magento module:enable CleatSquad_Smarty
    ./bin/magento setup:upgrade
    ```

Magento 2
---------

[](#magento-2)

### Components

[](#components)

A new engine has been added to this module which will allow you to use smarty. and this the injection of the new engine in the class Magento\\Framework\\View\\TemplateEngineFactory.

### Frontend Integration

[](#frontend-integration)

Your template files must have the file extension `.tpl` to get automatically recognized.

In your layout xml files or blocks please specify the new template

```

```

#### Example header.phtml converted to header.tpl

[](#example-headerphtml-converted-to-headertpl)

```

 id={$block->escapeHtmlAttr($block->getId())}"{/if}
        {if ($block->getAddBaseAttributeAria()) : ?>
            aria-labelledby="{$block->escapeHtmlAttr($block->getAddBaseAttributeAria())}"
        {/if}>
        {$titleHtml}

    {$block->getChildHtml()}

{/if}
```

```

```

#### Example breadcrumbs.phtml converted to breadcrumbs.tpl

[](#example-breadcrumbsphtml-converted-to-breadcrumbstpl)

```
