Location: PHPKode > scripts > Avatar Tools > controllers/extensions.php
<?php
/**
 * @version		$Id: coolfeed.php 100 2012-04-14 17:42:51Z hide@address.com $
 * @copyright	JoomAvatar.com
 * @author		Nguyen Quang Trung
 * @link		http://joomavatar.com
 * @license		License GNU General Public License version 2 or later http://www.gnu.org/licenses/gpl-2.0.html
 * @package		Avatar Dream Framework Template
 * @facebook 	http://www.facebook.com/pages/JoomAvatar/120705031368683
 * @twitter	    https://twitter.com/#!/JoomAvatar
 * @support 	http://joomavatar.com/forum/
 */

// no direct access
defined('_JEXEC') or die; 

class AvatarToolControllerExtensions {
		
	public function __call($method , $agrs)
	{
		$obj = explode('.', $method);
		
		return $this->_subController($obj, $agrs);
	}
	
	public function _subController ($obj, $agrs)
	{
		if ($obj[0]) 
		{
			$extension = $obj[0];
			$controller = $obj[1];
			$method = $obj[2];
			
			$cPath = AT_PATH_EXTENSIONS.DS.$extension.DS.'controllers'.DS.$controller.'.php';
			
			if (file_exists($cPath)) {
				require_once $cPath;	
				$controller = 'AvatarToolController'.$extension.$controller;
				$controller = new $controller;
				
				ob_start();
					if ($agrs) {
						$result = $controller->$method($agrs);
					} else {
						$result = $controller->$method();	
					}
				ob_end_clean();
				
				return $result;
			}
		}
		
		return '';
	}
}
Return current item: Avatar Tools