コード例 #1
0
 protected function handleGroupsType()
 {
     foreach ($this->config['groups'] as $gid => $buttons) {
         foreach ($buttons as $bid => $button) {
             $this->button($bid, $button, $gid);
         }
     }
     $groupIds = $this->buttons->pluck('groupId')->unique();
     $groups = [];
     foreach ($groupIds as $gid) {
         $groups[$gid] = $this->buttons->where('groupId', $gid)->all();
     }
     return $this->render(compact('groups'));
 }
コード例 #2
0
ファイル: Codex.php プロジェクト: codexproject/core
 public static function registerExtension($class, $name, $extension)
 {
     if (null === static::$resolved) {
         static::$resolved = new Collection();
     }
     \Illuminate\Container\Container::getInstance()->resolving($class, function ($instance) use($name, $extension) {
         $className = get_class($instance);
         $isExtended = static::$resolved->where('className', $className)->where('name', $name)->count() > 0;
         if ($isExtended) {
             return;
         }
         static::$resolved->push(compact('className', 'name'));
         forward_static_call_array($className . '::extend', [$name, $extension]);
     });
 }