We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28554
    • 201 Posts
    Hi guys,

    I want to use the php function rawurlencode for an output-filter, I’m no php-hero, and this would be the first snippet I ever create,, and I’m not quite sure about all this, ’but considering the documentation, would the snipped rawurlencode look sort of like this? (warning: aircode coming up)

    $output = rawurlencode($input)
    
      • 22303 MODX Staff
      • 10,725 Posts
      Quote from: StevenLangbroek at Jul 15, 2010, 06:41 AM

      Hi guys,

      I want to use the php function rawurlencode for an output-filter, I’m no php-hero, and this would be the first snippet I ever create,, and I’m not quite sure about all this, ’but considering the documentation, would the snipped rawurlencode look sort of like this? (warning: aircode coming up)

      $output = rawurlencode($input)
      


      You need to return the output...
      return rawurlencode($input)
      

        • 28554
        • 201 Posts
        Quote from: OpenGeek at Jul 15, 2010, 09:56 AM

        Quote from: StevenLangbroek at Jul 15, 2010, 06:41 AM

        Hi guys,

        I want to use the php function rawurlencode for an output-filter, I’m no php-hero, and this would be the first snippet I ever create,, and I’m not quite sure about all this, ’but considering the documentation, would the snipped rawurlencode look sort of like this? (warning: aircode coming up)

        $output = rawurlencode($input)
        


        You need to return the output...
        return rawurlencode($input)
        



        Well that surely made my page come to a screeching halt... My snippet looks like this:

        chunk: urlencode
        <?php
         return rawurlencode($input)
        ?>
        


        And I call it like this in a getResources tpl-chunk: [[+tv.projectPicture:urlencode]]

        Am I missing something? Besides basic php-skills I mean smiley.
          • 22303 MODX Staff
          • 10,725 Posts
          A semicolon to end the statement.
            • 28554
            • 201 Posts
            Quote from: OpenGeek at Jul 15, 2010, 11:58 AM

            A semicolon to end the statement.

            Gheh, thanks... I should really dive into PHP, been about 5-6 years since I last used it.