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 8605381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:48:59+00:00 2026-06-12T02:48:59+00:00

So I’m pretty new to Symfony2 and I’m trying to use the camelize filter

  • 0

So I’m pretty new to Symfony2 and I’m trying to use the camelize filter in a twig template. However when I request the page I get an error saying that the filter doesn’t exist:

The filter “camelize” does not exist in ::base.html.twig

Here’s the line from my template file:

{{ ‘hello world’ | camelize }}

The filter is listed on Twig’s quick reference page.

I’m confused, doesn’t Symfony2 support all of twig’s filters? There seem to be quite a few missing, why? And if it doesn’t support them, then is there any way to add the missing ones in?

Thanks in advance!

edit Ok, so it turns out I’m retarded and I need to remember to check that I’ve actually got the right git project. No wonder I was confused. Thanks replies!

  • 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-12T02:49:00+00:00Added an answer on June 12, 2026 at 2:49 am

    Your link points to a fork on GitHub, meaning a modified copy of the original project. The original project is https://github.com/fabpot/Twig.

    There is no camelize filter in Twig. Built-in filters are here. You can write your own camilize filter (it’s easy, actually…) following this tutorial: How to write a custom Twig Extension.

    EDIT: just for fun, you can write something like:

    class MyTwigExtension extends Twig_Extension
    {
        public function getFilters()
        {
            return array(
                'camelize' => new Twig_Filter_Method($this, 'camelizeFilter'),
            );
        }
    
        public function camelizeFilter($value)
        {
            if(!is_string($value)) {
                return $value;
            }
    
            $chunks    = explode(' ', $value);
            $ucfirsted = array_map(function($s) { return ucfirst($s); }, $chunks);
    
            return implode('', $ucfirsted);
        }
    
        public function getName()
        {
            return 'my_twig_extension';
        }
    }
    

    Note that this is a quick and dirty filter! Take a look at the built-in filters to learn best practice!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.