Skip to content

Public API: GustavContent

Lucas Krause edited this page Jan 24, 2015 · 2 revisions

##Instance functions

###void __construct( string|string[] $path )

The class's constructor that is called when a new instance is created.
If the passed path doesn't point on a file, a RuntimeException is thrown. If the file's GvBlock can't be processed, a RuntimeException is thrown, too. If everything worked properly, the newly created object is initialized.

$path
The path of the source file containing the content. Gets passed to GustavBase::path().

###string getPath()

Returns the source file's path.

###GustavBlock|mixed|null getBlock( [ string|null $option = null ] )

A global getter function returning the source file's GvBlock or just one of its options' values.
See GustavBlock::get() for more information.

$option
The name of the GvBlock's option whose value should be returned. If it doesn't exist, null is returned. If set to null, the GustavBlock object is returned.

Returns either the whole GvBlock or just a single option's value.

###string get()

Returns the finalized source content. See GustavContent::finalizeContent() for more information.

Clone this wiki locally