Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Asset] Allow object implementing __toString() being passed to packages #15158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

[Asset] Allow object implementing __toString() being passed to packages #15158

wants to merge 1 commit into from

Conversation

lstrojny
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n.A.
License MIT
Doc PR n.A.

This fixes an issue where LiipImagineBundle would return a Twig_Markup instance and one passes that to the assets() helper.

@Tobion
Copy link
Contributor

Tobion commented Jun 30, 2015

👎 this is usually the wrong solution. All these parameters are supposed to be a string, and not an object. So the calling code must be fixed and not the library.

@stof
Copy link
Member

stof commented Jun 30, 2015

LiipImagineBundle is returning a Twig_Markup from a Twig filter. I guess this is to avoid auto-escaping. But there is a much more sensible way to do it, which will not suffer from this issue: marking the filter as returning safe content.

And btw, I don't see any reason why LiipImagineBundle does that. The string they return is not escaped AFAICT.

In any case, this should be fixed in LiipImagineBundle instead

@lstrojny lstrojny closed this Jun 30, 2015
fabpot added a commit that referenced this pull request May 6, 2021
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[TwigBridge] Add form templates for Bootstrap 5

| Q             | A
| ------------- | ---
| Branch       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        | [#15158](symfony/symfony-docs#15158)

This PR add support for [Bootstrap 5](https://v5.getbootstrap.com/)

* Removal of the `form-group` class as it no longer exists in Bootstrap 5. Instead, row `div` have a `mb-3` class by default that can be override with the `row_attr` option.
* Errors are no longer display inside `label` but after the `widget` (or `help` if present).
* Replace `form-control` with `form-select` in `choice_widget_collapsed` block.
* Replace `form-control` with `form-range` in `form_widget_simple` block when the type is `range`.
* Add `form-control-color` to the `widget` class if type is `color`.
* Replace `small` with `div` element for `help` and also remove the `text-muted` class.
* Update the `percent_widget` and `money_widget` to handle correctly prepend and append elements.
* Drop support for custom file input as it's no longer (or yet ?) supported in Bootstrap 5

[Bootstrap 5 forms overview](https://v5.getbootstrap.com/docs/5.0/forms/overview/)
[Bootstrap 5 migration](https://v5.getbootstrap.com/docs/5.0/migration/)

Here is the result:

![bootstrap_5_layout](https://user-images.githubusercontent.com/5331654/100088569-9e1e9d80-2e50-11eb-88bf-2596e9ae7d28.png)
![bootstrap_5_horizontal_layout](https://user-images.githubusercontent.com/5331654/100088582-a24abb00-2e50-11eb-9b0c-09336c0327cd.png)

Commits
-------

d52d096 [TwigBridge] Add form templates for Bootstrap 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants