first commit
This commit is contained in:
17
templates/Simple/SimpleTemplate.php
Executable file
17
templates/Simple/SimpleTemplate.php
Executable file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace itguild\forms\form\templates\Simple;
|
||||
|
||||
use itguild\forms\form\templates\Template;
|
||||
|
||||
class SimpleTemplate extends Template
|
||||
{
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getInputTemplate(): string
|
||||
{
|
||||
return "<div class='form-group'>{label}<br>{input}</div>";
|
||||
}
|
||||
}
|
11
templates/Template.php
Executable file
11
templates/Template.php
Executable file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace itguild\forms\form\templates;
|
||||
|
||||
abstract class Template
|
||||
{
|
||||
|
||||
abstract static function getInputTemplate();
|
||||
|
||||
|
||||
}
|
37
templates/bootstrap5/Bootstrap5Template.php
Executable file
37
templates/bootstrap5/Bootstrap5Template.php
Executable file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace itguild\forms\form\templates\bootstrap5;
|
||||
|
||||
use itguild\forms\form\templates\Template;
|
||||
|
||||
class Bootstrap5Template extends Template
|
||||
{
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getInputTemplate(): string
|
||||
{
|
||||
return "<div class='form-group'>{label}{input}</div>";
|
||||
}
|
||||
public static function getTextAreaTemplate(): string
|
||||
{
|
||||
return "<div class='form-group'>{label}{textarea}</div>";
|
||||
}
|
||||
public static function getSelectTemplate(): string
|
||||
{
|
||||
return "<div class='form-group'>{label}{select}</div>";
|
||||
}
|
||||
public static function getRadioTemplate(): string
|
||||
{
|
||||
return "<div class='form-group'>{label}{radio}</div>";
|
||||
}
|
||||
public static function getCheckBoxTemplate(): string
|
||||
{
|
||||
return "<div class='form-group'>{label}{checkbox}</div>";
|
||||
}
|
||||
public static function getButtonTemplate(): string
|
||||
{
|
||||
return "<div class='form-group'>{label}{button}</div>";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user