Solar_Class_Stack::load()

public string Solar_Class_Stack::load ( string $name , bool $throw = true )

Loads a class using the class stack prefixes.

Parameters

  • (string) $name: The class to load using the class stack.

  • (bool) $throw: Throw an exception if no matching class is found in the stack (default true). When false, returns boolean false if no matching class is found.

Returns

  • (string) The full name of the loaded class.

Description

Loads a class using the class stack prefixes.

<?php
$stack = Solar::factory('Solar_Class_Stack');
$stack->add('Base1');
$stack->add('Base2');
$stack->add('Base3');

$class = $stack->load('Name');
// $class is now the first instance of '*_Name' found from the         
// class stack, looking first for 'Base3_Name', then            
// 'Base2_Name', then finally 'Base1_Name'.


Local