https://github.com/fly-studio/laravel-addons-smarty
https://github.com/fly-studio/laravel-addons-smarty
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/fly-studio/laravel-addons-smarty
- Owner: fly-studio
- License: mit
- Created: 2017-11-19T18:16:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-04-06T04:09:42.000Z (about 4 years ago)
- Last Synced: 2025-01-30T13:14:22.418Z (over 1 year ago)
- Language: PHP
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Smarty
======
This package lets you run Smarty3 on Laravel5 elegantly.
## Installation
```
composer require addons/smarty dev-master
```
Update your packages with ```composer update``` or install with ```composer install```.
## Usage
To use the Smarty Service Provider, you must register the provider when bootstrapping your Laravel application. There are
essentially two ways to do this.
Find the `providers` key in `config/app.php` and register the Smarty Service Provider.
```php
'providers' => [
// ...
'Addons\Smarty\View\SmartyServiceProvider',
]
```
Then publish the config file with `php artisan vendor:publish`. This will add the file `config/smarty.php`. This config file is the primary way you interact with Smarty.
Then simply reference templates using the normal dot syntax of Laravel.
For example to load smarty template `views/blog/post.tpl`, you would use `view('blog.post')`.
In Smarty `{include}` or `{extends}` tags, you should continue to use the full directory syntax, e.g. `{extends file="blog/post.tpl"}`.