mvcViewHelperFactory handles requests for view helpers, locates and loads the helper objects and general provides house keeping for the instantiated objects.


public __construct()

Creates a new helper factory

public reset()

Resets the object

public getHelper($inHelper, [$inHelperPrefix = 'mvcViewHelper'])

Returns the requested helper instance, creating one if it does not already exist

$inHelper should be the name of the helper, either the template function call or the classname. If the template function is given, it will be converted to mvcViewHelper[A-Z]... and a file will be located for the function name with .class.php appended. Only the mvcViewHelperFactory::$_HelperPaths will be searched.

When naming your view helper, be sure to follow the convention, otherwise it may not be loaded.

public getHelperClassStub($inHelperClass, [$inHelperPrefix = 'mvcViewHelper'])

Returns the trailing stub of the class from the helper

public addHelperPath($inPath)

Adds a search path for the helpers, paths are searched in the order they are added

public getHelperPath($inHelperClass, [$inHelperPrefix = 'mvcViewHelper'])

Returns the path to the view helper

public removeHelperPath($inPath)

Removes the search path

public addMapping($inHelperClass, $inPath)

Adds a helper class mapping to a path

public getMapping($inHelperClass)

Returns the mapped path to the helper class, false if not found

public removeMapping($inHelperClass)

Removes the class mapping

public addInstance($inHelperClass, $inObject)

Adds the instance of the helper class to the pool

public getInstance($inHelperClass)

Returns the existing instance of view helper, or null if not set

public removeInstance($inHelperClass)

Removes an instance of the view helper

<  1  >