I have found a lot of tutorials but none of them are worked. in my case i have an array of fonts returned from googlefontapi and i'm print it in page successfully now i want only 10 fonts loaded first time and others on scrolling my code
public function index(){
$url = "http://ift.tt/28ONRKg!";
$result = json_decode(file_get_contents( $url ));
$font_list = "";
foreach ( $result->items as $font )
{
$font_list[] = [
'font_name' => $font->family,
'category' => $font->category,
'variants' => implode(', ', $font->variants),
// subsets
// version
// files
];
}
return view('website_settings')->with('data', $font_list);
}
the view file
<div class="am-fonts">
<ul class="am-fonts-list">
@foreach($data as $fonts)
<li class="abc">
<link rel="stylesheet" href="http://ift.tt/1DTzkb1 echo $fonts['font_name'];?>:<?php echo $fonts['variants'];?>">
<div class="am-actions"><a href=""><span><i class="icon add"></i></span></a></div>
<div class="am-font-preview" style="font-family: <?php echo $fonts['font_name'];?>;">
<a href="#" class="details">Grumpy wizards make toxic brew for the evil Queen and Jack.</a>
</div>
<div class="am-font-details">
<div class="am-font-name">{!! $fonts['font_name'] !!}</div>
<div>12 styles</div>
</div>
</li>
@endforeach
</ul>
</div>
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/28S3oGZ
via IFTTT
Aucun commentaire:
Enregistrer un commentaire