/** * Default Constructor * * ### Settings: * * - `engine` Class name to use to replace Cake\I18n\Time functionality * The class needs to be placed in the `Utility` directory. * * @param \Cake\View\View $View The View this helper is being attached to. * @param array $config Configuration settings for the helper * @throws \Cake\Core\Exception\Exception When the engine class could not be found. */ public function __construct(View $View, array $config = []) { parent::__construct($View, $config); $config = $this->_config; $engineClass = App::className($config['engine'], 'Utility'); if ($engineClass) { $this->_engine = new $engineClass($config); } else { throw new Exception(sprintf('Class for %s could not be found', $config['engine'])); } }