Created
July 3, 2013 10:15
-
-
Save addorange/5916846 to your computer and use it in GitHub Desktop.
run external class connected to contao (e. g. for AJAX calls)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require('../system/initialize.php'); | |
class MyClass extends Frontend | |
{ | |
public function __construct() | |
{ | |
// Example: Load user object before calling the parent constructor | |
$this->import('FrontendUser', 'User'); | |
parent::__construct(); | |
} | |
public function run() | |
{ | |
// run my functions | |
} | |
} | |
/** | |
* Instantiate controller | |
*/ | |
$objMyClass = new MyClass(); | |
// Run code within MyClass() | |
$objMyClass->run(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment