Comments (6)
Can you post the generated HTML ? I'm not sure opening the form before the modal is cool with Bootstrap
from former.
The generate Code ist complete without Bootstrap. Only a Label with wrong Label name and the Input field, but sorry i have at this moment no correct html output
from former.
Wait actually, I don't think there are labels in vertical forms in Bootstrap, try with horizontal_open
.
from former.
Not working...
from former.
Ok I misunderstood the problem from the beginning, I'm really sorry. Just did a test from scratch — I thought the label wasn't displayed, while it is actually displayed but doesn't use the value you provide.
I'm looking into that.
UPDATE : Ok I get what is happening. You see Former keeps track of whether a a given field is displayed in a form or alone. For that it registers when a form opens, and when a form closes.
What is happening here, is that by the time the field is displayed, the template was already parsed by PHP and so the form was both opened and closed before the field is displayed. Thus, you don't get the label that was set on the control group (whose label is displayed), you get the label that was originally binded to the field itself when you created it, as fields outside of forms are displayed inline by default (ie without a wrapping control group).
Unfortunately as this is a core part of PHP I can't help much with that :/
The only solution I can suggest you is this :
<div class="modal-header system">
<h3>@yield('modal-title')</h3>
</div>
<div class="modal-body system">
@yield('modal-content')
</div>
<div class="modal-footer system">
@section('modal-footer')
<button class="btn" data-dismiss="modal" aria-hidden="true">Abbrechen</button>
<button class="btn btn-danger">Löschen</button>
@yield_section
</div>
@layout('templates.modal')
@section('modal-title')
Form Element Textfeld hinzufügen
@endsection
@section('modal-content')
{{ Former::vertical_open() }}
{{ Former::token() }}
{{ Former::text('name')->label('Nur ein Test') }}
@endsection
@section('modal-footer')
<button class="btn" data-dismiss="modal" aria-hidden="true">Abbrechen</button>
<button class="btn btn-success">Hinzufügen</button>
{{ Former::close() }}
@endsection
from former.
Ok this works, it's not cool but it works ;)
from former.
Related Issues (20)
- Add method to create new field from string HOT 7
- Allow field->required() to receive a boolean HOT 1
- Allow field->inline() to receive a boolean HOT 2
- Add a Choice field type HOT 4
- Laravel 5.7 support HOT 1
- Support Bootstrap4 HOT 1
- Former Twitter Bootstrap 4 Not working HOT 2
- Custom Rule classes not working HOT 1
- Bootstrap 4 Framework uses wrong classes for input group & no classes for checkbox HOT 8
- Can Former be used outside/without Laravel? HOT 2
- Multiple attributes treated differently from single attribute in queryToArray
- Form echo like a text Laravel 5.7
- Encode checkbox value to prevent XSS attack HOT 1
- Bootstrap 4 throws error without open and close tag HOT 2
- How to style checkboxes HOT 6
- Laravel 8 support. HOT 1
- How to use vuejs directives with former HOT 2
- Former::date help HOT 1
- _method HOT 2
- How to use as a standalone PHP HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from former.