コード例 #1
0
ファイル: Positions.php プロジェクト: legutierr/gantry5
 public function index()
 {
     /** @var UniformResourceLocator $locator */
     $locator = $this->container['locator'];
     $finder = new \Gantry\Component\Config\ConfigFileFinder();
     $files = $finder->getFiles($locator->findResources('gantry-config://positions'));
     $positions = array_keys($files);
     sort($positions);
     $this->params['positions'] = $positions;
     return $this->container['admin.theme']->render('@gantry-admin/pages/positions/positions.html.twig', $this->params);
 }
コード例 #2
0
 public function index()
 {
     /** @var UniformResourceLocator $locator */
     $locator = $this->container['locator'];
     $finder = new \Gantry\Component\Config\ConfigFileFinder();
     $files = $finder->getFiles($locator->findResources('gantry-layouts://'));
     $layouts = array_keys($files);
     sort($layouts);
     $layouts_user = array_filter($layouts, function ($val) {
         return strpos($val, 'presets/') !== 0 && substr($val, 0, 1) !== '_';
     });
     $layouts_core = array_filter($layouts, function ($val) {
         return strpos($val, 'presets/') !== 0 && substr($val, 0, 1) === '_';
     });
     $this->params['layouts'] = ['user' => $layouts_user, 'core' => $layouts_core];
     return $this->container['admin.theme']->render('@gantry-admin/pages/configurations/configurations.html.twig', $this->params);
 }