PHP code example of vi-kon / laravel-smarty-view
1. Go to this page and download the library: Download vi-kon/laravel-smarty-view 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/ */
vi-kon / laravel-smarty-view example snippets
// to your providers array
'ViKon\SmartyView\SmartyViewServiceProvider',
\View::make('route/to/template/file')
->with("param", null);
return array(
// Enable or disable caching
'caching' => false,
// Enable or disable debugging
'debugging' => false,
// Set cache lifetime
'cache_lifetime' => 3600,
// Check compile
'compile_check' => true,
// Set error reporting level in Smarty templates
'error_reporting' => null,
// Template directory
'template_dir' => app_path() . '/views',
// Cache directory
'cache_dir' => app_path() . '/storage/views/cache',
// Compile directory
'compile_dir' => app_path() . '/storage/views/compile',
// Plugins directory
'plugins_path' => array(),
);
public function boot()
\Event::listen('smarty-view.init', function ($config)
{
$config->set('smarty-view::plugins_path', array_merge(
$config->get('smarty-view::plugins_path'),
array(__DIR__ . DIRECTORY_SEPARATOR . 'smarty' . DIRECTORY_SEPARATOR . 'plugins')));
});
}
return Auth::check();
return Auth::getUser();
return Config::get($key, $default);
return array(
'sEmptyTable' => 'No data available in table',
'sInfo' => 'Showing _START_ to _END_ of _TOTAL_ entries',
'sInfoEmpty' => 'Showing 0 to 0 of 0 entries',
'sInfoFiltered' => '(filtered from _MAX_ total entries)',
'sInfoPostFix' => '',
'sInfoThousands' => ',',
'sLengthMenu' => 'Show _MENU_ entries',
'sLoadingRecords' => 'Loading...',
'sProcessing' => 'Processing...',
'sSearch' => 'Search:',
'sZeroRecords' => 'No matching records found',
'oPaginate' => array(
'sFirst' => 'First',
'sLast' => 'Last',
'sNext' => 'Next',
'sPrevious' => 'Previous',
),
'oAria' => array(
'sSortAscending' => '=> activate to sort column ascending',
'sSortDescending' => '=> activate to sort column descending',
),
);
return Form::open($params)
. $content
. Form::close()
smarty
{form_file _name="field-file"}