Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 58 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. <?php
  2.  
  3. use App\Kategori;
  4.  
  5. function getCategories($categories = null)
  6. {
  7.     if ($categories === null) {
  8.         $categories = Kategori::where('ust_kategori_id', 0)->get();
  9.     }
  10.  
  11.     $markup = "";
  12.  
  13.     foreach ($categories as $category) {
  14.         $markup .= '<li>' . $category->children !== null ? $category->kategori_adi .  getCategories($category->children) : $category->kategori_adi . '</li>';
  15.     }
  16.  
  17.     //return "<ul>{$markup}</ul>";
  18.     return $markup;
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top