islesurlasorguetourisme/daisyui-form-bundle
最新稳定版本:v0.2
Composer 安装命令:
composer require islesurlasorguetourisme/daisyui-form-bundle
包简介
A Symfony form theme bundle that provides seamless DaisyUI integration for automatically generated forms
README 文档
README
[WIP] DaisyUI Form Bundle
A Symfony bundle that provides partial form theme for DaisyUI components.
Features
- ✅ Partial DaisyUI component support - Form field types styled with DaisyUI classes
- 🎨 Tailwind CSS integration - Works seamlessly with Tailwind CSS utility classes
- 📱 Responsive design - Mobile-friendly form layouts out of the box
- ♿ Accessible - Maintains Symfony's accessibility features
Supported Form Types
- Text inputs, textareas, and all standard HTML5 input types
- Select dropdowns (with autocomplete support)
- Checkboxes and radio buttons
- Date, time, and datetime pickers
- Money and percent inputs
- File uploads
- Submit and reset buttons
- And more...
Installation
1. Install the bundle
composer require islesurlasorguetourisme/daisyui-form-bundle
2. Enable the bundle
If you're using Symfony Flex, the bundle is automatically enabled. Otherwise, add it to config/bundles.php:
return [ // ... Islesurlasorguetourisme\DaisyuiFormBundle\DaisyuiFormBundle::class => ['all' => true], ];
3. Configure the form theme
Add the form theme to your config/packages/twig.yaml:
twig: form_themes: - '@DaisyuiForm/form/daisyui_layout.html.twig'
4. Ensure DaisyUI is installed
Make sure you have DaisyUI and Tailwind CSS properly configured in your project:
npm install -D daisyui@latest
style.css
@import "tailwindcss"; @plugin "daisyui";
Usage
Once installed and configured, all your Symfony forms will automatically use DaisyUI styling:
// In your controller $form = $this->createFormBuilder() ->add('name', TextType::class) ->add('email', EmailType::class) ->add('message', TextareaType::class) ->add('send', SubmitType::class) ->getForm();
{# In your template #} {{ form(form) }}
That's it! Your form will be rendered with beautiful DaisyUI components.
Per-form theme override
To use the DaisyUI theme for a specific form:
{% form_theme form '@DaisyuiForm/form/daisyui_layout.html.twig' %}
{{ form(form) }}
Customization
Override specific blocks
Create your own form theme file and extend the DaisyUI theme:
{% extends '@DaisyuiForm/form/daisyui_layout.html.twig' %}
{% block form_row %}
{# Your custom form row markup #}
{{ parent() }}
{% endblock %}
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This bundle is released under the MIT License. See the LICENSE file for details.
Credits
- Developed and maintained by Isle sur la Sorgue Tourisme
- Built for Symfony
- Styled with DaisyUI
Support
If you encounter any issues or have questions:
- Open an issue on GitHub
- Check the Symfony Form documentation
- Refer to DaisyUI documentation
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-12