mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-02-24 17:52:25 +01:00
changing interface to improve rendering
This commit is contained in:
parent
f76b8b1ab3
commit
007a2d6171
@ -28,7 +28,7 @@ class Form extends FormElement
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function render()
|
||||
public function render($indent = 0)
|
||||
{
|
||||
$formCode = '';
|
||||
foreach ($this->_elements as $element) {
|
||||
|
@ -4,5 +4,5 @@ namespace DesignPatterns\Composite;
|
||||
|
||||
abstract class FormElement
|
||||
{
|
||||
abstract public function render();
|
||||
abstract public function render($indent = 0);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ namespace DesignPatterns\Composite;
|
||||
|
||||
class InputElement extends FormElement
|
||||
{
|
||||
public function render()
|
||||
public function render($indent = 0)
|
||||
{
|
||||
return '<input type="text" />';
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ namespace DesignPatterns\Composite;
|
||||
|
||||
class TextElement extends FormElement
|
||||
{
|
||||
public function render()
|
||||
public function render($indent = 0)
|
||||
{
|
||||
return 'this is a text element';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user