PHP 클래스 Capsule, symfony-1.4

파일 보기 프로젝트 열기: vjousse/symfony-1.4 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$vars The variables that can be used by the templates.

보호된 프로퍼티들

프로퍼티 타입 설명
$initialized Has template been initialized.
$outputDirectory string Where should output files be written? (This is named inconsistently to be compatible w/ Texen.)
$templatePath string Look for templates here (if relative path provided).

공개 메소드들

메소드 설명
__construct ( )
clear ( mixed $which = null ) : void Clears one or several or all variables.
display ( string $__template ) : void Low overhead (no output buffering) method to simply dump template to buffer.
get ( string $name ) : mixed Gets value of specified var or NULL if var has not been put().
getOutputDirectory ( ) : string Get basepath to use for output file creation.
getTemplatePath ( ) : string Get the basepath to use for template lookups.
parse ( string $template, string $outputFile = null, boolean $append = false ) : string Fetches the results of a tempalte parse and either returns the string or writes results to a specified output file.
put ( string $name, mixed $value ) Adds a variable to the context.
putAll ( array $vars, boolean $recursiveMerge = false ) : void Merges in passed hash to vars array.
putCopy ( string $name, mixed $value ) Makes a copy of the value and puts it into the context.
putRef ( $name, &$value ) Put a variable into the context, assigning it by reference.
setOutputDirectory ( string $v ) Set a basepath to use for output file creation.
setTemplatePath ( string $v ) Set the basepath to use for template lookups.

보호된 메소드들

메소드 설명
resolvePath ( string $file, string $basepath ) : string This returns a "best guess" path for the given file.

메소드 상세

__construct() 공개 메소드

public __construct ( )

clear() 공개 메소드

Clears one or several or all variables.
public clear ( mixed $which = null ) : void
$which mixed String name of var, or array of names.
리턴 void

display() 공개 메소드

Low overhead (no output buffering) method to simply dump template to buffer.
public display ( string $__template ) : void
$__template string
리턴 void

get() 공개 메소드

Gets value of specified var or NULL if var has not been put().
public get ( string $name ) : mixed
$name string Variable name to retrieve.
리턴 mixed

getOutputDirectory() 공개 메소드

Get basepath to use for output file creation.
public getOutputDirectory ( ) : string
리턴 string

getTemplatePath() 공개 메소드

Get the basepath to use for template lookups.
public getTemplatePath ( ) : string
리턴 string

parse() 공개 메소드

Fetches the results of a tempalte parse and either returns the string or writes results to a specified output file.
public parse ( string $template, string $outputFile = null, boolean $append = false ) : string
$template string The template filename (relative to templatePath or absolute).
$outputFile string If specified, contents of template will also be written to this file.
$append boolean Should output be appended to source file?
리턴 string The "parsed" template output.

put() 공개 메소드

Resulting template will have access to ${$name$} variable.
public put ( string $name, mixed $value )
$name string
$value mixed

putAll() 공개 메소드

Given an array like: array( 'myvar' => 'Hello', 'myvar2' => 'Hello') Resulting template will have access to $myvar and $myvar2.
public putAll ( array $vars, boolean $recursiveMerge = false ) : void
$vars array
$recursiveMerge boolean Should matching keys be recursively merged?
리턴 void

putCopy() 공개 메소드

This is primarily to force copying (cloning) of objects, rather than the default behavior which is to assign them by reference.
public putCopy ( string $name, mixed $value )
$name string
$value mixed

putRef() 공개 메소드

This means that if the template modifies the variable, then it will also be modified in the context.
public putRef ( $name, &$value )
$name

resolvePath() 보호된 메소드

This returns a "best guess" path for the given file.
protected resolvePath ( string $file, string $basepath ) : string
$file string File name or possibly absolute path.
$basepath string The basepath that should be prepended if $file is not absolute.
리턴 string "Best guess" path for this file.

setOutputDirectory() 공개 메소드

Set a basepath to use for output file creation.
public setOutputDirectory ( string $v )
$v string

setTemplatePath() 공개 메소드

Set the basepath to use for template lookups.
public setTemplatePath ( string $v )
$v string

프로퍼티 상세

$initialized 보호되어 있는 프로퍼티

Has template been initialized.
protected $initialized

$outputDirectory 보호되어 있는 프로퍼티

Where should output files be written? (This is named inconsistently to be compatible w/ Texen.)
protected string $outputDirectory
리턴 string

$templatePath 보호되어 있는 프로퍼티

Look for templates here (if relative path provided).
protected string $templatePath
리턴 string

$vars 공개적으로 프로퍼티

The variables that can be used by the templates.
public $vars