Skip to content

Instantly share code, notes, and snippets.

@hissy hissy/controller.php
Created Jul 16, 2014

What would you like to do?
#concrete5 How to load required models by the package controller
defined('C5_EXECUTE') or die("Access Denied.");
class ExamplePackage extends Package {
protected $pkgHandle = 'example';
protected $appVersionRequired = '5.6.3';
protected $pkgVersion = '1.0';
public function getPackageDescription() {
return t('This is an example package.');
public function getPackageName() {
return t('Example Package');
public function on_start() {
// autoload
public function install() {
// autoload
// do basic install process
$pkg = parent::install();
// import contents and settings
$ci = new ContentImporter();
$ci->importContentFile($pkg->getPackagePath() . '/install.xml');
protected static function autoLoad() {
// Load required classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.