1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
<?php
namespace Tev\Plugin\Action;
use Tev\Application\Application,
Tev\View\Renderer;
/**
* Base class for action providers.
*
* Extending classes provide a method which will be called as an action
* callback. This method should be called 'action()'.
*/
abstract class AbstractProvider
{
/**
* Application.
*
* @var \Tev\Application\Application
*/
protected $app;
/**
* View renderer.
*
* @var \Tev\View\Renderer
*/
protected $renderer;
/**
* Constructor.
*
* Inject dependencies.
*
* @param \Tev\Application\Application $app Application
* @param \Tev\View\Renderer $renderer View renderer
* @return void
*/
public function __construct(Application $app, Renderer $renderer)
{
$this->app = $app;
$this->renderer = $renderer;
}
/**
* Get the action priority of this provider.
*
* @return int Default 10
*/
public function priority()
{
return 10;
}
/**
* Get the number of arguments expected by the action method of this
* provider.
*
* @return int Default 1
*/
public function numArgs()
{
return 1;
}
}