本文整理汇总了PHP中Less_Environment::addFrames方法的典型用法代码示例。如果您正苦于以下问题:PHP Less_Environment::addFrames方法的具体用法?PHP Less_Environment::addFrames怎么用?PHP Less_Environment::addFrames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Less_Environment
的用法示例。
在下文中一共展示了Less_Environment::addFrames方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: compile
public function compile($env, $args = NULL, $important = NULL)
{
Less_Environment::$mixin_stack++;
$_arguments = array();
$mixinFrames = array_merge($this->frames, $env->frames);
$mixinEnv = new Less_Environment();
$mixinEnv->addFrames($mixinFrames);
$frame = $this->compileParams($env, $mixinEnv, $args, $_arguments);
$ex = new Less_Tree_Expression($_arguments);
array_unshift($frame->rules, new Less_Tree_Rule('@arguments', $ex->compile($env)));
$ruleset = new Less_Tree_Ruleset(null, $this->rules);
$ruleset->originalRuleset = $this->ruleset_id;
$ruleSetEnv = $env->copyEvalEnv(array_merge(array($this, $frame), $mixinFrames));
$ruleset = $ruleset->compile($ruleSetEnv);
if ($important) {
$ruleset = $ruleset->makeImportant();
}
Less_Environment::$mixin_stack--;
return $ruleset;
}
示例2: compile
public function compile($env, $args = NULL, $important = NULL)
{
$_arguments = array();
$mixinFrames = array_merge($this->frames, $env->frames);
$mixinEnv = new Less_Environment();
$mixinEnv->addFrames($mixinFrames);
$frame = $this->compileParams($env, $mixinEnv, $args, $_arguments);
$ex = new Less_Tree_Expression($_arguments);
array_unshift($frame->rules, new Less_Tree_Rule('@arguments', $ex->compile($env)));
$rules = $important ? Less_Tree_Ruleset::makeImportant($this->selectors, $this->rules)->rules : array_slice($this->rules, 0);
$ruleset = new Less_Tree_Ruleset(null, $rules);
// duplicate the environment, adding new frames.
$ruleSetEnv = new Less_Environment();
$ruleSetEnv->addFrame($this);
$ruleSetEnv->addFrame($frame);
$ruleSetEnv->addFrames($mixinFrames);
$ruleSetEnv->compress = $env->compress;
$ruleset = $ruleset->compile($ruleSetEnv);
$ruleset->originalRuleset = $this;
return $ruleset;
}