| 1 |
<?php |
| 2 |
/** |
| 3 |
* Base Controller Class |
| 4 |
* |
| 5 |
* @package Easy_Invoice |
| 6 |
* @subpackage Controllers |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace EasyInvoice\Controllers; |
| 10 |
|
| 11 |
use EasyInvoice\Traits\SecurityTrait; |
| 12 |
use EasyInvoice\Traits\TemplateTrait; |
| 13 |
use EasyInvoice\Traits\CurrencyTrait; |
| 14 |
use EasyInvoice\Traits\InvoiceTrait; |
| 15 |
|
| 16 |
/** |
| 17 |
* BaseController provides common functionality for all controllers |
| 18 |
*/ |
| 19 |
abstract class BaseController { |
| 20 |
// Include all the traits |
| 21 |
use SecurityTrait; |
| 22 |
use TemplateTrait; |
| 23 |
use CurrencyTrait; |
| 24 |
use InvoiceTrait; |
| 25 |
|
| 26 |
/** |
| 27 |
* Initialize the controller |
| 28 |
* This method should be implemented by all child controllers |
| 29 |
*/ |
| 30 |
abstract public function init(); |
| 31 |
|
| 32 |
/** |
| 33 |
* Display method to be implemented by child classes |
| 34 |
* This ensures all controllers have a standardized way to display content |
| 35 |
* |
| 36 |
* @param array $args Optional arguments for the display |
| 37 |
*/ |
| 38 |
abstract public function display(array $args = []); |
| 39 |
} |