Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7954437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:25:42+00:00 2026-06-04T03:25:42+00:00

I need to put unescaped URL generated from path into input element. routing.yml profile_delete:

  • 0

I need to put unescaped URL generated from path into input element.

routing.yml

profile_delete:
  pattern: /student_usun/{id}
  defaults: { _controller: YyyXXXBundle:Profile:delete }

list.html.twig

<input id="deleteUrl" value="{{ path('profile_delete', {id: '$'}) }}"/>

The result is:

<input id="deleteUrl" value="/student_usun/%24"/>

I tried |raw filter and also put twig code between {% autoescape false %} tag and result is still the same.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T03:25:44+00:00Added an answer on June 4, 2026 at 3:25 am

    Twig doesn’t come with a url_decode filter to match its url_encode one, so you’ll need to write it.

    in src/Your/Bundle/Twig/Extension/YourExtension.php

    <?php
    
    namespace Your\Bundle\Twig\Extension;
    
    class YourExtension extends \Twig_Extension
    {
        /**
         * {@inheritdoc}
         */
        public function getFilters()
        {
            return array(
                'url_decode' => new \Twig_Filter_Method($this, 'urlDecode')
            );
        }
    
        /**
         * URL Decode a string
         *
         * @param string $url
         *
         * @return string The decoded URL
         */
        public function urlDecode($url)
        {
            return urldecode($url);
        }
    
        /**
         * Returns the name of the extension.
         *
         * @return string The extension name
         */
        public function getName()
        {
            return 'your_extension';
        }
    }
    

    And then add it to your services configuration in app/config/config.yml

    services:
        your.twig.extension:
            class: Your\Bundle\Twig\Extension\YourExtension
            tags:
                -  { name: twig.extension }
    

    And then use it!

    <input id="deleteUrl" value="{{ path('profile_delete', {id: '$'})|url_decode }}"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to put greek letters into a URL, for example: www.example.com?id=σκ I have
I need to put $input into the file spelled.. but this code leaves the
I need to put a JSON object into an attribute on an HTML element.
I need to put a custom hover menu from http://www.addthis.com/help/toolbox , but Rails uses
I need to put a date into the title attribute of an image so
I need to put some of the entities created via a.dbml Linq-To-Sql file into
I need to put the values retrieved using a Fetch Request from my core
Need to put the frequency of each number occurrence into a 1D array and
I need to put my ObservableCollection<ValidationMessage> into my TextBlock . Here is my code.
I need to put the contents of a java.nio.ByteBuffer into an java.io.OutputStream . (wish

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.