mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-09-25 22:09:23 +02:00
a REAL abstract factory not a helper-like full of static
This commit is contained in:
25
AbstractFactory/HtmlFactory.php
Normal file
25
AbstractFactory/HtmlFactory.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* DesignPatternPHP
|
||||
*/
|
||||
|
||||
namespace DesignPatterns\AbstractFactory;
|
||||
|
||||
/**
|
||||
* HtmlFactory is a concrete factory for HTML component
|
||||
*/
|
||||
class HtmlFactory extends AbstractFactory
|
||||
{
|
||||
|
||||
public function createPicture($path, $name = '')
|
||||
{
|
||||
return new Html\Picture($path, $name);
|
||||
}
|
||||
|
||||
public function createText($content)
|
||||
{
|
||||
return new Html\Text($content);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user