API > eden > loader.php
View Source

class Eden_Loader

Handler for class autoloading. Many developers writing object-oriented applications create one PHP source file per-class definition. One of the biggest annoyances is having to write a long list of needed includes at the beginning of each script (one for each class). When a class is not found an Autoload class is used to define how it is found. I have adopted Zend's autoloading logic where a class name with underscores is the actual location of that class if the underscores were replaced with foward slashes. For example: Eden_Cache_Model is located at eve/cache/model.

Public Methods

public function addRoot($path)

Allows extra paths to search in before looking in the root first

Arguments

  1. *string the path

Returns Eden_Autoload

public function handler($class)

Logically includes a class if not included already.

Arguments

  1. *string the class name

Returns bool

public function load($class)

Logically includes a class if not included already.

Arguments

  1. *string the class name

Returns this


© 2012 Openovate Labs. All rights reserved.