Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

Laravel Smarty

ytake/laravel-smarty image

Laravel Smarty stats

Downloads
239.7K
Stars
0
Open Issues
0
Forks
0

View on GitHub →

Smarty template engine for Laravel and Lumen

smarty template engine for laravel4

#This Project Has Been Deprecated new Laravel.Smarty Project -> Laravel.Smarty

##install 導入方法 ###for Laravel4.2

"require": {
"comnect/smarty": "2.*"
},

###for Laravel4.1

"require": {
"comnect/smarty": "1.*"
},

##Basic smarty template for laravel4

laravel4でsmartyを使用できます。
bladeの構文をそのまま使用することができ、
それに加え、View Facadeを通じてsmartyのmethodはすべて利用可能です。
easily use all the methods of smarty
###required array short syntax!

// laravel4 blade template render
View::make('template', ['hello']);
// use smarty method
View::assign('word', 'hello');
View::clearAllAssign(); // smarty method

##Artisan キャッシュクリア、コンパイルファイルの削除がコマンドラインから行えます。
smarty's cacheclear, remove compile class from Artisan(cli) ###cache clear

$ php artisan comnect:smarty-cacheclear

Options:
--file (-f) specify file
--time (-t) clear all of the files that are specified duration time
###remove compile class

$ php artisan comnect:smarty-clear-compiled

Options:
--file (-f) specify file

usage 使い方

install後、 app/config配下のapp.phpのproviders配列に以下のnamespaceを追加してください。
add providers

'Comnect\Smarty\SmartyServiceProvider'

configファイルをpublishします。
publish configure

$ php artisan config:publish comnect/smarty

app/config/packages配下に追加されます。
publish to app/config/packages

views配下にsmartyファイルがあればそれをテンプレートと使用し、
なければ通常通りbladeテンプレートかphpファイルを使用します。

smartyテンプレート内にも*{{app_path()}}*等のヘルパーそのまま使用できます。
その場合、delimiterをbladeと同じものを指定しない様にしてください。

configファイルでこれらの指定が可能です。

sample

layout.sample
layout.extends.sample

ytake photo

Web | ML | Streaming Data Application Developer


Ytake Laravel Smarty Related Articles

HydePHP v2 image

HydePHP v2

Read article
Supercharge Your Laravel Projects: Real AI Coding with Laravel Boost! image

Supercharge Your Laravel Projects: Real AI Coding with Laravel Boost!

Read article
Build a Smart AI Task Manager with Laravel, Livewire & PrismPHP image

Build a Smart AI Task Manager with Laravel, Livewire & PrismPHP

Read article
Using Language Servers in Sublime Text image

Using Language Servers in Sublime Text

Read article
Lint and Fix Your Laravel Code with Duster image

Lint and Fix Your Laravel Code with Duster

Read article
Reaching for Facades image

Reaching for Facades

Read article
Laravel Cloud logo

Laravel Cloud

Easily create and manage your servers and deploy your Laravel applications in seconds.

Laravel Cloud
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum