本文整理汇总了PHP中Twig_Loader_Filesystem::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Twig_Loader_Filesystem::__construct方法的具体用法?PHP Twig_Loader_Filesystem::__construct怎么用?PHP Twig_Loader_Filesystem::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Twig_Loader_Filesystem
的用法示例。
在下文中一共展示了Twig_Loader_Filesystem::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($paths = array(), $extension = null)
{
parent::__construct($paths);
if (is_null($extension)) {
$this->extension = $extension;
}
}
示例2: __construct
/**
* Constructor.
*
* @param FileLocatorInterface $locator A FileLocatorInterface instance
* @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance
*/
public function __construct(FileLocatorInterface $locator, TemplateNameParserInterface $parser)
{
parent::__construct(array());
$this->locator = $locator;
$this->parser = $parser;
$this->cache = array();
}
示例3: __construct
/**
* Constructor.
*
* @param FileLocatorInterface $locator A FileLocatorInterface instance
* @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance
* @param ActiveTheme $activeTheme
*/
public function __construct(FileLocatorInterface $locator, TemplateNameParserInterface $parser, ActiveTheme $activeTheme = null)
{
parent::__construct(array());
$this->locator = $locator;
$this->parser = $parser;
$this->activeTheme = $activeTheme;
}
示例4: __construct
/**
* AliasLoader constructor.
*
* @param $paths
* An array of paths to pass to the parent constructor.
* @param $aliases
* An array of alias/path pairs.
*/
public function __construct($paths, $aliases)
{
parent::__construct($paths);
foreach ($aliases as $alias => $path) {
$this->addPath($path, $alias);
}
}
示例5: __construct
/**
* Constructs a new FilesystemLoader object.
*
* @param string|array $paths
* A path or an array of paths to check for templates.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler service.
* @param \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler
* The theme handler service.
*/
public function __construct($paths = array(), ModuleHandlerInterface $module_handler, ThemeHandlerInterface $theme_handler)
{
parent::__construct($paths);
// Add namespaced paths for modules and themes.
$namespaces = array();
foreach ($module_handler->getModuleList() as $name => $extension) {
$namespaces[$name] = $extension->getPath();
}
foreach ($theme_handler->listInfo() as $name => $extension) {
$namespaces[$name] = $extension->getPath();
}
foreach ($namespaces as $name => $path) {
$this->addPath($path . '/templates', $name);
}
}
示例6: __construct
/**
* Constructor.
*
* @param string|array $paths A path or an array of paths where to look for templates
*/
public function __construct($theme, $base_theme = array())
{
$cached = cache_get($theme . ':twig_paths');
$paths = array();
if ($cached) {
$this->setPaths($cached->data, $theme);
$paths = array_merge($paths, $cached->data);
}
foreach ($base_theme as $theme_info) {
$cached = cache_get($theme_info->name . ':twig_paths');
if ($cached) {
$this->setPaths($cached->data, $theme_info->name);
$paths = array_merge($paths, $cached->data);
}
}
parent::__construct($paths);
}
示例7: __construct
/**
* TwigFilesystemLoader constructor.
*
* @param array|string $paths
* @param string $separator
*/
public function __construct($paths, $separator = '.')
{
$this->separator = $separator;
parent::__construct($paths);
}
示例8: __construct
public function __construct()
{
parent::__construct();
}
示例9: __construct
public function __construct(Application $application)
{
parent::__construct();
$this->setApplication($application)->setPaths($application->getAbsolutePath(Environment::DIR_TEMPLATES));
}
示例10: __construct
/**
* Constructor
*
* @param string|array $paths
* @param string $extension
* @return void
*/
public function __construct($paths = [], $extension = 'twig')
{
parent::__construct($paths);
$this->extension = $extension;
}
示例11: __construct
/**
* Constructor.
*
* @param FilesystemInterface $filesystem The filesystem to use
* @param array|string $paths A path or an array of paths where to look for templates
*/
public function __construct(FilesystemInterface $filesystem, $paths = [])
{
$this->filesystem = $filesystem;
parent::__construct($paths);
}
示例12: __construct
/**
* Constructor.
*
* @param TemplateNameParserInterface $nameParser A TemplateNameParserInterface instance
*/
public function __construct(TemplateNameParserInterface $nameParser, array $paths = array(), LoggerInterface $logger = null)
{
parent::__construct($paths);
$this->nameParser = $nameParser;
$this->logger = $logger;
}
示例13: __construct
/**
* Constructor.
*
* @param FilesystemLoader $loader
* @param TemplateNameParserInterface $parser
*/
public function __construct(FilesystemLoader $loader, TemplateNameParserInterface $parser = null)
{
parent::__construct([]);
$this->loader = $loader;
$this->parser = $parser ?: new TemplateNameParser();
}
示例14: __construct
public function __construct(tubepress_api_log_LoggerInterface $logger, array $paths)
{
parent::__construct($paths);
$this->_logger = $logger;
$this->_shouldLog = $logger->isEnabled();
}
示例15:
function __construct($paths, $alwaysReload = false)
{
$this->alwaysReload = $alwaysReload;
parent::__construct($paths);
}