This is the API documentation for concrete5 version 5.6 and earlier. View Current API Documentation

Class Concrete5_Library_Loader

A wrapper for loading core files, libraries, applications and models. Whenever possible the loader class should be used because it will always know where to look for the proper files, in the proper order.

Direct known subclasses


Package: Core
Category: Concrete
Copyright: Copyright (c) 2003-2008 Concrete5. (
License: MIT License
Author: Andrew Embler
Located at core/libraries/loader.php

Methods summary

public static
# library( $lib, $pkgHandle = null )

Loads a library file, either from the site's files or from Concrete's

public static
# job( $job, $pkgHandle = null )

Loads a job file, either from the site's files or from Concrete's

public static
# model( $mod, $pkgHandle = null )

Loads a model from either an application, the site, or the core Concrete directory

protected static
# legacyModel( $model )
# packageElement( $file, $pkgHandle, $args = null )
# element( $_file, $args = null, $_pkgHandle = null )

Loads an element from C5 or the site

public static
# tool( $file, $args = null, $pkgHandle = null )

Loads a tool file from c5 or site

public static
# registerAutoload( $classes )

Registers a component with concrete5's autoloader.

protected static
public static
# autoloadCore( $class )
public static
# autoload( $class )
public static
# block( $bl )

Loads a block's controller/class into memory.

<?php self::block('autonav'); ?>
# database( )

Loads the various files for the database abstraction layer. We would bundle these in with the db() method below but these need to be loaded before the models which need to be loaded before db()

public static ADOConnection
# db( $server = null, $username = null, $password = null, $database = null, $create = false, $autoconnect = true )

Returns the database object, or loads it if not yet created

$db = Loader::db();
public static
# helper( $file, $pkgHandle = false )

Loads a helper file. If the same helper file is contained in both the core concrete directory and the site's directory, it will load the site's first, which could then extend the core.

# package( $pkgHandle )
# startingPointPackage( $pkgHandle )
# pageTypeControllerPath( $ctHandle )

Gets the path to a particular page type controller

public static
# controller( $item )

Loads a controller for either a page or view

Properties summary

public static array $autoloadClasses
# array()