Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php /** * This file is part of the LidaaTwigBundle package. */ namespace Lidaa\TwigB..

Decoded Output download

<?php

/**
 * This file is part of the LidaaTwigBundle package.
 */

namespace Lidaa\TwigBundle\Helper;

use Symfony\Component\Routing\Generator\UrlGeneratorInterface;


/**
 * LinkHelper
 *
 * @author Lidaa <[email protected]>
 */
class LinkHelper
{
    private $generator;

    public function __construct(UrlGeneratorInterface $generator)
    {	
        $this->generator = $generator;
    }

    public function renderLinkTo($title, $name, $parameters, $options)
    {
    	$url = $this->generator->generate($name, $parameters);
    	
    	$attributes = '';
    	foreach ($options as $key => $value) {
    		$attributes.= ' ' . $key . '="' . $value . '"';
    	}
    	
    	return '<a href="' . $url . '"' . $attributes . '>' . $title . '</a>';
    }
    
    public function renderLinkToggle($type, $condition, $title, $options)
    {
        if ((!$condition && $type == 'if') || ($condition && $type == 'unless'))
            return '';

        if (!key_exists('href', $options))
            $options['href'] = '#';

        $attributes = '';
        foreach ($options as $key => $value) {
            $attributes.= ' ' . $key . '="' . $value . '"';
        }

        return '<a' . $attributes . '>' . $title . '</a>';
    }

    public function mailTo($email, $title, $options)
    {
        $title = (string) $title;

        if ($title == "") {
            $title = $email;
        }

        $attributes = '';
        foreach ($options as $key => $value) {
            $attributes.= ' ' . $key . '="' . $value . '"';
        }

        return '<a href="mailto:' . $email . '"' . $attributes . '>' . $title . '</a>';
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

/**
 * This file is part of the LidaaTwigBundle package.
 */

namespace Lidaa\TwigBundle\Helper;

use Symfony\Component\Routing\Generator\UrlGeneratorInterface;


/**
 * LinkHelper
 *
 * @author Lidaa <[email protected]>
 */
class LinkHelper
{
    private $generator;

    public function __construct(UrlGeneratorInterface $generator)
    {	
        $this->generator = $generator;
    }

    public function renderLinkTo($title, $name, $parameters, $options)
    {
    	$url = $this->generator->generate($name, $parameters);
    	
    	$attributes = '';
    	foreach ($options as $key => $value) {
    		$attributes.= ' ' . $key . '="' . $value . '"';
    	}
    	
    	return '<a href="' . $url . '"' . $attributes . '>' . $title . '</a>';
    }
    
    public function renderLinkToggle($type, $condition, $title, $options)
    {
        if ((!$condition && $type == 'if') || ($condition && $type == 'unless'))
            return '';

        if (!key_exists('href', $options))
            $options['href'] = '#';

        $attributes = '';
        foreach ($options as $key => $value) {
            $attributes.= ' ' . $key . '="' . $value . '"';
        }

        return '<a' . $attributes . '>' . $title . '</a>';
    }

    public function mailTo($email, $title, $options)
    {
        $title = (string) $title;

        if ($title == "") {
            $title = $email;
        }

        $attributes = '';
        foreach ($options as $key => $value) {
            $attributes.= ' ' . $key . '="' . $value . '"';
        }

        return '<a href="mailto:' . $email . '"' . $attributes . '>' . $title . '</a>';
    }
}

Function Calls

None

Variables

None

Stats

MD5 c2a94fdeac649ad1bb6ccb5bded816f7
Eval Count 0
Decode Time 92 ms