~xibo-maintainers/xibo/tempel

« back to all changes in this revision

Viewing changes to lib/Twig/UrlDecodeTwigExtension.php

  • Committer: Dan Garner
  • Date: 2015-03-26 14:08:33 UTC
  • Revision ID: git-v1:70d14044444f8dc5d602b99890d59dea46d9470c
Moved web servable files to web folder

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
/*
3
 
 * Spring Signage Ltd - http://www.springsignage.com
4
 
 * Copyright (C) 2015 Spring Signage Ltd
5
 
 * (UrlDecodeTwigExtension.php)
6
 
 */
7
 
 
8
 
 
9
 
namespace Xibo\Twig;
10
 
 
11
 
 
12
 
class UrlDecodeTwigExtension extends \Twig_Extension
13
 
{
14
 
    /**
15
 
     * {@inheritdoc}
16
 
     */
17
 
    public function getFilters()
18
 
    {
19
 
        return array(
20
 
            'url_decode' => new \Twig_Filter_Method($this, 'urlDecode')
21
 
        );
22
 
    }
23
 
 
24
 
    /**
25
 
     * URL Decode a string
26
 
     *
27
 
     * @param string $url
28
 
     *
29
 
     * @return string The decoded URL
30
 
     */
31
 
    public function urlDecode( $url )
32
 
    {
33
 
        return urldecode( $url );
34
 
    }
35
 
 
36
 
    /**
37
 
     * Returns the name of the extension.
38
 
     *
39
 
     * @return string The extension name
40
 
     */
41
 
    public function getName()
42
 
    {
43
 
        return 'url_decode';
44
 
    }
45
 
}
 
 
b'\\ No newline at end of file'