daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 37 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function add() { 
  2.   // ....
  3.   $parentCategories = $this->StoreProductCategories->ParentStoreCategories->find('treeList', [
  4.       // Expected result:
  5.       //
  6.       // Root Category
  7.       //  ↳ Shoes
  8.       //      ↳ Nike
  9.       //
  10.       'spacer' => function($item) {
  11.           dd(__LINE__);
  12.           $spaceChar = ' ';
  13.           $level = $item->level - 1;
  14.           return str_repeat($spaceChar, $level) . '↳';
  15.       }
  16.   ]);
  17. }
RAW Paste Data
Top