PHP 클래스 SassContext

Defines the context that the parser is operating in and so allows variables to be scoped. A new context is created for Mixins and imported files.
파일 보기 프로젝트 열기: richthegeek/phpsass 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$content tree representing any contextual content.
$functions mixins defined in this context
$mixins mixins defined in this context
$node the node being processed
$parent enclosing context
$variables variables defined in this context

공개 메소드들

메소드 설명
__construct ( $parent = null ) : SassContext SassContext constructor.
addFunction ( string $name, mixed $function ) : SassFunctionDefinitionNode Adds a function
addMixin ( string $name, mixed $mixin ) : SassMixinDefinitionNode Adds a mixin
getContent ( )
getFunction ( string $name ) : SassFunctionDefinitionNode Returns a function
getMixin ( string $name ) : SassMixinDefinitionNode Returns a mixin
getVariable ( string $name ) : string Returns a variable defined in this context
hasFunction ( string $name ) : boolean Returns a boolean wether this function exists
hasVariable ( string $name ) : boolean Returns a value indicating if the variable exists in this context
merge ( ) Makes variables and mixins from this context available in the parent context.
setVariable ( string $name, sassLiteral $value ) : SassContext Sets a variable to the given value
setVariables ( $vars )

메소드 상세

__construct() 공개 메소드

SassContext constructor.
public __construct ( $parent = null ) : SassContext
리턴 SassContext

addFunction() 공개 메소드

Adds a function
public addFunction ( string $name, mixed $function ) : SassFunctionDefinitionNode
$name string name of function
$function mixed
리턴 SassFunctionDefinitionNode the function

addMixin() 공개 메소드

Adds a mixin
public addMixin ( string $name, mixed $mixin ) : SassMixinDefinitionNode
$name string name of mixin
$mixin mixed
리턴 SassMixinDefinitionNode the mixin

getContent() 공개 메소드

public getContent ( )

getFunction() 공개 메소드

Returns a function
public getFunction ( string $name ) : SassFunctionDefinitionNode
$name string name of function to return
리턴 SassFunctionDefinitionNode the mixin

getMixin() 공개 메소드

Returns a mixin
public getMixin ( string $name ) : SassMixinDefinitionNode
$name string name of mixin to return
리턴 SassMixinDefinitionNode the mixin

getVariable() 공개 메소드

Returns a variable defined in this context
public getVariable ( string $name ) : string
$name string name of variable to return
리턴 string the variable

hasFunction() 공개 메소드

Returns a boolean wether this function exists
public hasFunction ( string $name ) : boolean
$name string name of function to check for
리턴 boolean

hasVariable() 공개 메소드

Returns a value indicating if the variable exists in this context
public hasVariable ( string $name ) : boolean
$name string name of variable to test
리턴 boolean true if the variable exists in this context, false if not

merge() 공개 메소드

Note that if there are variables or mixins with the same name in the two contexts they will be set to that defined in this context.
public merge ( )

setVariable() 공개 메소드

Sets a variable to the given value
public setVariable ( string $name, sassLiteral $value ) : SassContext
$name string name of variable
$value sassLiteral value of variable
리턴 SassContext

setVariables() 공개 메소드

public setVariables ( $vars )

프로퍼티 상세

$content 공개적으로 프로퍼티

tree representing any contextual content.
public $content

$functions 공개적으로 프로퍼티

mixins defined in this context
public $functions

$mixins 공개적으로 프로퍼티

mixins defined in this context
public $mixins

$node 공개적으로 프로퍼티

the node being processed
public $node

$parent 공개적으로 프로퍼티

enclosing context
public $parent

$variables 공개적으로 프로퍼티

variables defined in this context
public $variables