I'm starting a new project with Laravel (I'm new with it) and I have a question on the best practices when working with dynamic forms that depend of user role.
See, my pure HTML markup is something like
<!--Each panel contains one ore more forms that only specific users can access-->
<div id="panel-admin" class="panel panel-default">
<div class="panel-heading panel-heading-custom">
<h4 class="panel-title">
<i class="fa fa-chevron-right"></i><a> Adm</a>
</h4>
</div>
<div class="panel-body">
<form role="form" id="adm-config" data-toggle="validator">
<div class="row">
<!--Inputs-->
</div>
</form>
</div>
</div>
<div id="panel-doctor" class="panel panel-default">...</div>
<div id="panel-user" class="panel panel-default">...</div>
So, an admin user will just see the first panel, a doctor user will just see the second panel and so on...
Since each panel has a specific jquery behavior and also some style, I'll use the @stack to dynamic include my js and css files, but my question is:
Should I also use stack to include the HTML markup itself or the blade engine has some other resource for this kind thing? Which is the best practice when working with Laravel?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire