Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added to
TimeType
extension possibility to render form as `single_t…
…ext` (similar to DateType option) (issue #1205) Adjusted `DateTimeType` to allow usage of this new feature
- Loading branch information
Showing
6 changed files
with
185 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 24 additions & 13 deletions
37
src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/time_widget.html.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
<div <?php echo $view['form']->renderBlock('container_attributes') ?>> | ||
<?php | ||
// There should be no spaces between the colons and the widgets, that's why | ||
// this block is written in a single PHP tag | ||
echo $view['form']->widget($form['hour'], array('attr' => array('size' => 1))); | ||
echo ':'; | ||
echo $view['form']->widget($form['minute'], array('attr' => array('size' => 1))); | ||
|
||
if ($with_seconds) { | ||
<?php if ($widget == 'single_text'): ?> | ||
<input type="text" | ||
<?php echo $view['form']->renderBlock('attributes') ?> | ||
name="<?php echo $view->escape($full_name) ?>" | ||
value="<?php echo $view->escape($value) ?>" | ||
<?php if ($read_only): ?>disabled="disabled"<?php endif ?> | ||
<?php if ($required): ?>required="required"<?php endif ?> | ||
<?php if ($max_length): ?>maxlength="<?php echo $max_length ?>"<?php endif ?> | ||
/> | ||
<?php else: ?> | ||
<div<?php echo $view['form']->renderBlock('container_attributes') ?>> | ||
<?php | ||
// There should be no spaces between the colons and the widgets, that's why | ||
// this block is written in a single PHP tag | ||
echo $view['form']->widget($form['hour'], array('attr' => array('size' => 1))); | ||
echo ':'; | ||
echo $view['form']->widget($form['second'], array('attr' => array('size' => 1))); | ||
} | ||
?> | ||
</div> | ||
echo $view['form']->widget($form['minute'], array('attr' => array('size' => 1))); | ||
|
||
if ($with_seconds) { | ||
echo ':'; | ||
echo $view['form']->widget($form['second'], array('attr' => array('size' => 1))); | ||
} | ||
?> | ||
</div> | ||
<?php endif ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters