-
Notifications
You must be signed in to change notification settings - Fork 5
split TemplateRendererInterface
in multiple interfaces
#14
Comments
What do you mean by
I think you can already use it without setting paths? I didn't try it yet though. |
I call Pareto here: seen this only once in my ZF projects, and it got phased out immediately as a build-time step/cache.
|
@xtreamwayz the point is was trying to make is not where you store your templates. My point is if a single interface should have all the responsibilities of being able to Consider a more or less standard class MyAction extends MiddlewareInterface
{
/**
* @var TemplateRendererInterface
*/
private $renderer;
public function __construct(TemplateRendererInterface $renderer)
{
$this->renderer = $renderer;
}
public function process(Request $request, Delegate $delegate)
{
return new HtmlResponse($this->renderer->render('templateName'));
}
} Only the As @Ocramius said, that |
This repository has been closed and moved to mezzio/mezzio-template; a new issue has been opened at mezzio/mezzio-template#1. |
Following the Interface Segregation Principle I would like to propose to split the
TemplateRendererInterface
in three smaller interfacesThen we could redefine
TemplateRendererInterface
asOften, when
TemplateRendererInterface
is required as a dependency, only therender
method is actually used. With this proposal, we could use and type hint only onRendererInterface
.This could turn out useful if we want to implement a renderer which does not have the need to be configured with a set of paths to work properly
The text was updated successfully, but these errors were encountered: