src/ApiBundle/Api/Util/AssetHelper.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace ApiBundle\Api\Util;

use Symfony\Component\DependencyInjection\ContainerInterface;

class AssetHelper
{
    /**
     * @var ContainerInterface
     */
    private static $container;

    public static function getFurl($path, $defaultKey = false)
    {
        return self::$container->get('web.twig.extension')->getFurl($path, $defaultKey);
    }

    public static function uriForPath($path)
    {
        return self::$container->get('request')->getUriForPath($path);
    }

    public static function getScheme()
    {
        return self::$container->get('request')->getScheme();
    }

    public static function callAppExtensionMethod($method, $params)
    {
        return call_user_func_array(array(self::$container->get('web.twig.app_extension'), $method), $params);
    }

    public static function renderView($view, array $parameters = array())
    {
        return self::$container->get('templating')->render($view, $parameters);
    }

    /**
     * @param ContainerInterface $container
     */
    public static function setContainer(ContainerInterface $container)
    {
        self::$container = $container;
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。