PHP code example of pafnuty / laravel-fenom

1. Go to this page and download the library: Download pafnuty/laravel-fenom library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pafnuty / laravel-fenom example snippets


'providers' => [
    ...
    'Illuminate\Validation\ValidationServiceProvider',
    //'Illuminate\View\ViewServiceProvider',
    ...
    'Pafnuty\Fenom\FenomViewServiceProvider',
]

public function index() {
    return view('myfolder/welcome.tpl');
}

$ php artisan clear-compiled

$ php artisan vendor:publish --provider="Pafnuty\Fenom\FenomViewServiceProvider"
smarty
{for ($i = 0 to = 10)
    The current value is {$i}
{forelse}
    No values
{/for}

{foreach $list as $key => $value}
    {$key}: {$value}
{foreachelse}
    Empty
{/foreach}

{set $errors = $.errors}
    
{if $errors->any()}  
    {foreach $errors->all() as $error} 
        {$error}
    {/foreach}
{/if}