User tests: Successful: Unsuccessful:
Pull Request for Issue #19580.
This pr illustrates how I see the component services implemented. Through an interface the component class defines which services it provides. The base ComponentInterface
contains now only the getDisptacher
function as this is mandatory for every component. Like that we can introduce new services later without a BC break and do not loose any type hinting.
For every service is a trait available to avoid duplicate code amongst the other components. The following code should illustrate how such a component class will look like:
class FooComponent extends Component implements
MVCFactoryServiceInterface,
CategoriesServiceInterface,
AssociationServiceInterface
{
use MVCFactoryServiceTrait;
use CategoriesServiceTrait;
use AssociationServiceTrait;
}
Additionally the interface BootableExtensionInterface
is added where a component class can load its internal class loader or register HTML services in a boot function:
public function boot(ContainerInterface $container)
{
require_once 'vendor/autoload.php';
$this->getRegistry()->register('fooicon', new Icon($container->get(SiteApplication::class)));
}
All is working as expected.
All is working as expected.
Needs a bigger update on docs.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_associations com_categories com_content com_fields com_menus com_tags Libraries |
Labels |
Added:
?
|
Category | Administration com_associations com_categories com_content com_fields com_menus com_tags Libraries | ⇒ | Administration com_associations com_categories com_content com_fields com_menus com_tags Front End Libraries |
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-05-06 17:23:43 |
Closed_By | ⇒ | wilsonge |
Not 100% convinced by the
loadHelper
method - but this is definitely a massive improvement on what we have now - so will merge :) Thanks for much for the patience on this