laravel-blade

Is that possible to use laravel blade outside the view folder?

帅比萌擦擦* 提交于 2020-08-21 19:44:08
问题 I got a wordpress blog inside the public sub folder. I wanted to use same layout with the laravel view that using blade. Is there anyway to achieve that? 回答1: I managed to do this with the following function: function bladeCompile ($from, $to, $data) { $fs = new \Illuminate\Filesystem\Filesystem; $b = new \Illuminate\View\Compilers\BladeCompiler($fs, __DIR__); $src = $b->compileString (file_get_contents($from)); $isPhp = false; if (substr( $src, 0, 5 ) === "<?php") { $isPhp = true; $src =

Is that possible to use laravel blade outside the view folder?

北城以北 提交于 2020-08-21 19:42:27
问题 I got a wordpress blog inside the public sub folder. I wanted to use same layout with the laravel view that using blade. Is there anyway to achieve that? 回答1: I managed to do this with the following function: function bladeCompile ($from, $to, $data) { $fs = new \Illuminate\Filesystem\Filesystem; $b = new \Illuminate\View\Compilers\BladeCompiler($fs, __DIR__); $src = $b->compileString (file_get_contents($from)); $isPhp = false; if (substr( $src, 0, 5 ) === "<?php") { $isPhp = true; $src =

laravel $data the result not show when using ckeditor

无人久伴 提交于 2020-07-10 08:39:41
问题 i have a page for maintenable email template. i used ck editor to add the text. and i have a data to read so in ckeditor i will write like Dear Valued Customer, Your application has been route approved Details : Name: {{$data->name}}, phone: {{$data->phone}}, and this will save to column text_email and i declare $data in controller but when i send the email, the ouput will show {{$data->name}} not the value of $data->name ; public function send_email($id){ $data=Data::where('id',$id)->first()

How to get the only hours and minutes in laravel blade?

折月煮酒 提交于 2020-07-06 20:09:40
问题 I am trying to get hours and minutes and seconds in blade, normally I use like below {{$calllog['delivery_date']}} but now my requirement is to get hours and minutes and seconds. here is how I tried to get $calllog['delivery_date']->todatestring()}} Yeah, I think I misuse for this function, can someone help me out? I am new in Laravel. Any help would be greatly appreciated. 回答1: If your variable is a DateTime, you can use this : {{ Carbon\Carbon::parse($calllog['delivery_date'])->format('H:i

How to get the only hours and minutes in laravel blade?

匆匆过客 提交于 2020-07-06 20:01:48
问题 I am trying to get hours and minutes and seconds in blade, normally I use like below {{$calllog['delivery_date']}} but now my requirement is to get hours and minutes and seconds. here is how I tried to get $calllog['delivery_date']->todatestring()}} Yeah, I think I misuse for this function, can someone help me out? I am new in Laravel. Any help would be greatly appreciated. 回答1: If your variable is a DateTime, you can use this : {{ Carbon\Carbon::parse($calllog['delivery_date'])->format('H:i

Google AMP with Laravel

允我心安 提交于 2020-06-09 18:49:31
问题 I have recently launched an ecommerce site based on laravel. And now i really think its a good idea to implement AMP as it supports ecommerce now (even shopify and ebay are implementing it) So my query is how can we implement AMP on laravel? Is there a way to use desktopMainTempalte.blade.php for desktop version and switch to mobileMainTemplate.blade.php on mobile version? I just don't want to create a different domain for mobile device as m.domain.com. I want something creative here but Im

laravel blade creating url

若如初见. 提交于 2020-05-26 08:57:46
问题 I have a simple problem, basically I am getting name of the website from database and create a link according to it's name. it looks like: @foreach ($websites as $website) <a class="websites" href=" {{ asset ($website->name )}}"> {{ asset ($website->name )}} </a> @endforeach Which gives for example: http://localhost/name Howver links needs to be like this: http://localhost/website/name how can I add /website into my URL using blade template in laravel? 回答1: Try this: {{ url('website/' .