phpvms/app/Providers/DirectiveServiceProvider.php
B.Fatih KOZ 617cea5df7
SimBrief Planning System Update (#991)
* SimBrief Planning System Update

Replaces outdated old pr.

Same improvements apply to both controller and simbrief_form.blade.

* Style Fix for SimBrief.Controller

* strict equals fix and some comments

changed equals to strict equals and put in some comments about the loadarray and manualrmk generation.

* Formatting/separate out secstohhmm

* Formatting

* Removed duplicates

We have the $wakecat, $equipment and $transponder in the controller, removed them from the blade.

Fixed a harmless typo in the IVAO Prefile DEPTIME line

Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
Co-authored-by: Nabeel Shahzad <nabeel@nabeel.sh>
2021-01-17 15:59:32 -05:00

28 lines
727 B
PHP

<?php
namespace App\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
/**
* Keep custom directives that can be used in templates
*/
class DirectiveServiceProvider extends ServiceProvider
{
public function boot(): void
{
Blade::directive('minutestotime', function ($expr) {
return "<?php echo \App\Support\Units\Time::minutesToTimeString($expr); ?>";
});
Blade::directive('minutestohours', function ($expr) {
return "<?php echo \App\Support\Units\Time::minutesToHours($expr); ?>";
});
Blade::directive('secstohhmm', function ($expr) {
return "<?php echo secstohhmm($expr); ?>";
});
}
}