Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: g:\Work\WWW\php\tbox\lib/csnippet.phps
PHP Documentation - PHP/Toolbox

CSnippet

CSnippet

The root html snippet class.

 

private class CSnippet

The root html snippet class.
It provides some core functionality -- in particular construction with list of arbitrary fields. Use its private methods to override the default behavior of the CSnippet-based classes.

 
Direct known subclasses: CMarkup, CCalendar, CForm, CSplitBar, CField, CTextMenu

Public Method Summary

void

CSnippet([ array $fields ])

Constructs the snippet
void

append(array $fields)

Appends arbitrary field list to the snippet.

Private Method Summary

string

qualify(string $varName)

Qualifies input name by snippet id.
mixed

getGlobal(string $varName, [ mixed $default ])

Returns the value from global namespace or default
mixed

setGlobal(string $varName, mixed $value)

Sets the value to global namespace variable.
string

write( $str)

Just 'echoes' the string by default.
void

flush()

Just flushes the output buffer by default.
void

writeCode( $code, string $eval)

No additional comments.

Private Field Summary

string

$id

Id allows distinguish the CSnippet's instances on the page

Public Method Details

CSnippet

public void CSnippet( [ array $fields ] )

  Constructs the snippet
from arbitrary field list, e.g | $snippet = new CSnippet(array( | "custom_field_1" => "custom_value_1, | "custom_field_2" => "custom_value_2, | "custom_field_3" => "custom_value_3, | ... | )); It just uses append() method.

Parameter
array $fields = >>array()<<
- list (array) of fields.
Returns void

See Also append()

append

public void append( array $fields )

  Appends arbitrary field list to the snippet.

Parameter
array $fields
- list (array) of fields.
Returns void


Private Method Details

qualify

private string qualify( string $varName )

  Qualifies input name by snippet id.

Parameter
string $varName
- the name to be qualified.
Returns string

- $this->id.$varName.


getGlobal

private mixed getGlobal( string $varName, [ mixed $default ] )

  Returns the value from global namespace or default
if global variable is not set.

Parameter
string $varName
mixed $default = >>""<<
- default value
Returns mixed


setGlobal

private mixed setGlobal( string $varName, mixed $value )

  Sets the value to global namespace variable.

Parameter
string $varName
mixed $value
- new value.
Returns mixed

- new value.


write

private string write( $str )

  Just 'echoes' the string by default.
Use it to override this default behavior, e.g. to redirect output to file.

Parameter
$str
No additional comments.
Returns string

- input string.


flush

private void flush( )

  Just flushes the output buffer by default.
Use it to override this default behavior, e.g. to flush to file.

Returns void


writeCode

private void writeCode( $code, string $eval )

 

No additional comments.

Parameter
$code
No additional comments.
string $eval
No additional comments.
Returns void


Private Field Details

$id

private string $id

>>""<<

Id allows distinguish the CSnippet's instances on the page
e.g. if an array of instances of the same form is needed, sort of.



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta