1. Go to this page and download the library: Download t3g/symfony-template-bundle 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/ */
t3g / symfony-template-bundle example snippets
namespace App\Menu;
use T3G\Bundle\TemplateBundle\Menu\MenuBuilder as TemplateMenuBuider;
class MenuBuilder extends TemplateMenuBuider
{
public function mainDefault(array $options)
{
$menu = parent::mainDefault($options);
$menu->addChild(
'home',
[
'route' => 'app_index',
'label' => 'Home',
'extras' => [
'icon' => 'home',
],
]
);
return $menu;
}
}
twig
{% if template_function_exist('relativetime') %}
The relativetime function is available.
{% endif %}
twig
# Template will still work if `encore_entry_link_tags` is not defined, function just returns null.
{{ template_function_call('encore_entry_link_tags', template.application.assets.encore_entrypoint) }}
# Template will fail if `encore_entry_link_tags` is not registered.
{{ encore_entry_link_tags(template.application.assets.encore_entrypoint) }}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.