cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

Potentially redundant classes

Open roman-kulish opened this issue 13 years ago • 1 comments

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.

roman-kulish avatar Jan 08 '13 03:01 roman-kulish

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.

niden avatar Jan 25 '13 21:01 niden