本文整理汇总了PHP中Less_Parser::Reset方法的典型用法代码示例。如果您正苦于以下问题:PHP Less_Parser::Reset方法的具体用法?PHP Less_Parser::Reset怎么用?PHP Less_Parser::Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Less_Parser
的用法示例。
在下文中一共展示了Less_Parser::Reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initCompiler
/**
* @return \Less_Parser
*/
protected function _initCompiler()
{
if ($this->_compiler) {
return $this->_compiler;
}
$options = array('compress' => false, 'strictUnits' => false, 'strictMath' => false, 'relativeUrls' => true, 'cache_method' => false, 'sourceMap' => false, 'indentation' => ' ');
if ($this->_isDebug()) {
$options['sourceMap'] = true;
$options['sourceMapRootpath'] = $this->_options->get('root_path');
$options['sourceMapBasepath'] = $this->_options->get('root_path');
}
// Create compilier
$this->_compiler = new \Less_Parser($options);
$this->_compiler->Reset();
// Global depends
$mixins = $this->_options->get('autoload');
foreach ($mixins as $mixin) {
$this->_compiler->parseFile($mixin);
}
// Add custom vars
$this->_compiler->ModifyVars((array) $this->_options->get('global_vars', []));
// Set paths
$importPaths = (array) $this->_options->get('import_paths', []);
foreach ($importPaths as $fullPath => $relPath) {
$this->setImportPath($fullPath, $relPath);
}
// Set cutsom functions
$functions = (array) $this->_options->get('functions', [], 'arr');
foreach ($functions as $name => $function) {
$this->_compiler->registerFunction($name, $function);
}
return $this->_compiler;
}
示例2: reset
/**
* Resets all configurations.
*
* @return void
*/
public function reset()
{
$this->compiler->Reset();
}