Created
November 28, 2012 16:38
-
-
Save dongilbert/4162419 to your computer and use it in GitHub Desktop.
Joomla Namespace Example
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 // File: index.php | |
| const JPATH_BASE = __DIR__; | |
| require_once JPATH_BASE . '/libraries/joomla/loader.php'; | |
| Joomla\Loader::registerNamespace('Joomla', JPATH_BASE . '/libraries/joomla'); | |
| Joomla\Application\Web::getInstance('\\Joomla\\Application\\Web')->execute(); |
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 // File: libraries/joomla/application/base.php | |
| namespace Joomla\Application; | |
| class Base {} |
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 // File: libraries/joomla/application/web.php | |
| namespace Joomla\Application; | |
| // Here we extend Base, because we are in the same namespace. | |
| class Web extends Base {} |
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 // File: libraries/joomla/controller/base.php | |
| namespace Joomla\Controller; | |
| // We simply extend Controller, since we are in the same namespace. | |
| class Base extends Controller {} |
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 // File: libraries/joomla/controller/controller.php | |
| namespace Joomla\Controller; | |
| // This extends Serializable from the Global Namespace | |
| class Controller extends \Serializable {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment