Replies: 2 comments
-
I wonder if it would be helpful to add an image function to Html that returns an input element of type image? While it might create some confusion between img and image, the choice could be defended since image is the name of the input type where as img is the name of an html tag. Going a little further, considering the full list of input types, the following are currently not included/implemented (at least not here in the Html file):
the button, file, reset, and tel functions already exist so that could complicate things a little but color, image, month, search, url, and week could be implemented without too much trouble. If there are already implemented in another way, it might be helpful to create some documentation or comments to make it clear how best to implement. It looks like color, month, and week are not universally supported on all browsers so those could likely be ignored until there is better browser compatibility. |
Beta Was this translation helpful? Give feedback.
-
Just doing some quick testing as proof of concept, I added an image function to Html as follows:
Then in my blade I called:
instead of:
Then I started thinking how I could make use of the existing code and avoid customizing it. If I replace the Form::image with:`
which with the exception of the id being set, is the same as the original output with LaravelCollective Form::Image:
Hopefully this makes what I am hoping to accomplish clear enough for a discussion about how best to resolve in a way that is consistent with the way that the package is intended to be used. |
Beta Was this translation helpful? Give feedback.
-
To migrate from LaravelCollective to laravel-html, I ran the HTML shift and discovered one element that did not shift correctly, namely Form::image.
Form::image('images/delete.png','btnDelete',['class' => 'm-1 btn btn-danger','title'=>'Delete'])
that would output:
<input class="m-1 btn btn-danger" title="Delete" src="https://polanco.montserratretreat.org/images/delete.png" name="btnDelete" type="image">
What would be the recommended way for handling this? In terms of completeness, it would be nice if there was a 1:1 mapping of all of the LaravelCollective methods in Laravel-Html; however, I don't know if that is really the direction folks would go but that would guarantee that it is possible to shift everything. I also read about extending laravel-html and figured that might be another option. I figured I would open the discussion here to get some input on the recommended way to proceed.
Beta Was this translation helpful? Give feedback.
All reactions