/** * @internal param \Auryn\Injector $injector * @internal param $category * @return TextResponse */ public function renderCategoryIndex() { $injectionParams = new InjectionParams(); $injectionParams->defineParam('pageTitle', "Imagick demos"); $injectionParams->alias('ImagickDemo\\Navigation\\Nav', 'ImagickDemo\\Navigation\\CategoryNav'); return JigExecutable::create('categoryIndex', $injectionParams); }
public function testAlias() { $injectorMock = Mockery::mock('Auryn\\Injector'); $injectorMock->shouldReceive('alias')->with('foo', 'bar')->once(); $params = new InjectionParams(); $params->alias('foo', 'bar'); $params->addToInjector($injectorMock); }
/** * Helper function to allow template rendering to be easier. * @param $templateName * @param array $sharedObjects * @return Executable */ public static function renderTemplateExecutable($templateName, InjectionParams $injectionParams = null) { if ($injectionParams === null) { $injectionParams = new InjectionParams(); } $fn = function (Jig $jigRender) use($templateName, $injectionParams) { $className = $jigRender->compile($templateName); $injectionParams->alias('Jig\\JigBase', $className); $fn = function (Injector $injector) use($className) { return $injector->make($className); }; $injectionParams->delegate('Jig\\JigBase', $fn); return new Executable(['Tier\\Tier', 'createHtmlBody'], $injectionParams); }; return new Executable($fn); }