Home > Net >  Twig Url Path Shortener & PHP
Twig Url Path Shortener & PHP

Time:10-07

I have PHP theme with Twig template, but I can't shorten the URL.

File path:

public_html/app/views/theme/faq.twig

What I want to do:

https://{{ site['url'] }}/faq

How can I do that?

Edit: i am looking for this code thanks to everyone who helped

<?php

$title .= $languageArray["casino.title"];

if( $user["client_type"] == 1  ){
  Header("Location:".site_url('logout'));
}

CodePudding user response:

Is it that you want to implement a routing capability? Because it seems to me like that's what you need.

CodePudding user response:

Generally, you need to create some sort of route for that.

If the theme would be for one specific site, you would create those routes within that site's "routing.yml", but when it is a theme, you probably want to put those routes into a file like "theme_path/theme_name/config/routing.yml".

Read up on more routing documentation in the official documentation: https://symfony.com/doc/current/routing.html#introduction

  • Related