Conventions
File/dir hierarchy
Every extension needs to be in one directory named in CamelCase
style because this directory is part of the PHP namespace.
$ tree Example
Example
├── ExampleExtension.php # Required: The extension class with the name "<Dir>Extension.php"
└── ExampleApiConnector.php # Optional: Any other class file needed by the extension
Naming conventions
PHP namespace
For correct auto loading it’s mandatory to use this PHP namespace.
<?php
namespace Iacbox\Loginpage\Extension\<YourExtensionDir>;
// example: extension dir is "example", extension class is "ExampleExtension"
// any other class file in the same dir has to have this namespace too to be unique.
namespace Iacbox\Loginpage\Extension\Example;
Include Statements
For correct working of extensions some additional classes need to be included
// parent classes of extensions (only used when needed)
use Iacbox\Loginpage\Extension\Extension;
use Iacbox\Loginpage\Extension\ElementExtension;
use Iacbox\Loginpage\Extension\LoginMethodExtension;
use Iacbox\Loginpage\Extension\RequestHandlerExtension;
// interfaces for extensions (only used when needed)
use Iacbox\Loginpage\Extension\ConfigurableLpExtension;
use Iacbox\Loginpage\Extension\FormPostEntryListener;
use Iacbox\Loginpage\Extension\FormPostLeaveListener;
use Iacbox\Loginpage\Extension\PrepareForRenderListener;
use Iacbox\Loginpage\Router\ElementRequestHandler;
// login page classes used in extensions
use Iacbox\Loginpage\Request;
use Iacbox\Loginpage\Session;
use Iacbox\Loginpage\Response;
use Iacbox\Loginpage\Html\HtmlBuilder;
use Iacbox\Loginpage\Comm\LoginServiceResponse;
use \DOMElement;