|
Previous Page |
Solar_Class_Stack |
Next Class |
set()
public
void
set (
array|string $list
)
Clears the stack and adds one or more classes.
Parameters
- (array|string)
$list: The classes to add to the stack after clearing it.
Returns
- (void)
Description
Clears the stack and adds one or more classes.
<?php
$stack = Solar::factory('Solar_Class_Stack');
$stack->add('Base1');
$stack->add('Base2');
$stack->add('Base3');
// $stack->get() reveals that the directory search order is
// 'Base3_', 'Base2_', 'Base1_'.
$stack->set('Another_Base');
// $stack->get() is now array('Another_Base_').
?>