cphalcon
cphalcon copied to clipboard
Potentially redundant classes
These classes below are not properly documented. Phalcon\Mvc\User\Module is not covered by documentation at all. Internally they are all similar.
- Phalcon\Mvc\User\Component
- Phalcon\Mvc\User\Module
- Phalcon\Mvc\User\Plugin
Basically, any class optionally implementing either or both
- Phalcon\DI\InjectionAwareInterface
- Phalcon\Events\EventsAwareInterface
... can act as a component or a plugin. For example,
<?php
class DummyComponent
{
function dummy() {}
}
// add it to the $di
$di->set('dummy', function() { return new DummyComponent(); });
// use inside view
<?php echo $this->dummy->dummy(); ?>
In my opinion there is no need to have three empty classes to be extended to implement user components and plugins.
These classes are there for future functionality. We introduced them a while back but there is a purpose for them in the future and they will be documented once they are implemented.