Skip to content

Commit

Permalink
Render format option
Browse files Browse the repository at this point in the history
  • Loading branch information
nacmartin committed Jun 4, 2016
1 parent 90520a8 commit ead27f4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/Limenius/Liform/Transformer/IntegerTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ class IntegerTransformer
{
public function transform(FormInterface $form)
{
return [
$schema = [
'type' => 'integer',
];
if ($liform = $form->getConfig()->getOption('liform')) {
if ($format = $liform['format']) {
$schema['format'] = $format;
}
}
return $schema;

}
}
10 changes: 8 additions & 2 deletions src/Limenius/Liform/Transformer/NumberTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ class NumberTransformer
{
public function transform(FormInterface $form)
{
return [
'type' => 'number'
$schema = [
'type' => 'number',
];
if ($liform = $form->getConfig()->getOption('liform')) {
if ($format = $liform['format']) {
$schema['format'] = $format;
}
}
return $schema;

}
}
8 changes: 7 additions & 1 deletion src/Limenius/Liform/Transformer/StringTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ class StringTransformer
{
public function transform(FormInterface $form)
{
return [
$schema = [
'type' => 'string',
];
if ($liform = $form->getConfig()->getOption('liform')) {
if ($format = $liform['format']) {
$schema['format'] = $format;
}
}
return $schema;
}
}

0 comments on commit ead27f4

Please sign in to comment.