-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #290 from sherlockode/fix/data_serialization
Fix data serialization for multiple choice types
- Loading branch information
Showing
4 changed files
with
52 additions
and
18 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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Sherlockode\AdvancedContentBundle\Form\Type; | ||
|
||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
|
||
class ElementHideOnType extends AbstractType | ||
{ | ||
/** | ||
* @return string | ||
*/ | ||
public function getParent() | ||
{ | ||
return ChoiceType::class; | ||
} | ||
|
||
/** | ||
* @param OptionsResolver $resolver | ||
*/ | ||
public function configureOptions(OptionsResolver $resolver) | ||
{ | ||
$resolver->setDefaults([ | ||
'choices' => [ | ||
'responsive.devices.mobile_portrait' => 'xs', | ||
'responsive.devices.mobile_landscape' => 'sm', | ||
'responsive.devices.tablet_portrait' => 'md', | ||
'responsive.devices.tablet_landscape' => 'lg', | ||
'responsive.devices.desktop' => 'xl', | ||
], | ||
'multiple' => true, | ||
'expanded' => true, | ||
]); | ||
} | ||
} |
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