RUTA:
{% set route = path(app.request.attributes.get('_route') %}
RUTA MAS LOS PARAMETROS:
{% set route = path(app.request.attributes.get('_route'),
app.request.attributes.get('_route_params')) %}
<a href="{{ app.request.basepath }}/es/{{route}}"><img src="{{ app.request.basepath }}/images/xxx.jpg" alt=""></a>
--------------------------------------------
{{('hola', {nombre:'Pepe'})}}
EJEMPLO CON VARIOS PARAMETROS:
{{ path('hola', {nombre: 'Pepe', edad: 21}) }}
$app->mount('/hola/{nombre}/{edad}', include 'controllers/holaController.php');
$CAux->get('/', function(Request $request,$nombre, $edad) use ($app) {... }
-----------------------------------------------
{% if (app.request.locale == "es") %} {{ xxx }} {% endif %}
{% if (app.request.locale == "en") %} {{ xxx }} {% endif %}
{% if (app.request.locale == "fr") %} {{ xxx }} {% endif %}
{% if (app.request.locale == "pt") %} {{ xxx }} {% endif %}
No hay comentarios:
Publicar un comentario