コード例 #1
0
ファイル: routes.php プロジェクト: jalmelb/24hl2015
     $data['original_numeric'] = '';
     $data['datestamp'] = 0;
     if ($page == 'page') {
         $page = basename($folder);
         if ($page == '') {
             $page = '/';
         }
         $folder = dirname($folder);
         $data['full_slug'] = $page;
     }
 }
 // Get/Set Status
 if ($data['slug'] === 'page') {
     $data['status'] = array_get($data, 'status', Slug::getStatus($data['folder']));
 } else {
     $data['status'] = array_get($data, 'status', Slug::getStatus($page));
 }
 if ($data['slug'] != 'page' && File::exists("{$content_root}/{$folder}/fields.yaml")) {
     $fields_raw = file_get_contents("{$content_root}/{$folder}/fields.yaml");
     $fields_data = YAML::Parse($fields_raw);
     if (isset($fields_data['fields'])) {
         # fields.yaml controls the fields
         $data['fields'] = $fields_data['fields'];
     } elseif (isset($fields_data['_fieldset'])) {
         # using a fieldset
         $fieldset = $fields_data['_fieldset'];
         $fs = Statamic_Fieldset::load($fieldset);
         $fieldset_data = $fs->get_data();
         $data['fields'] = $fieldset_data['fields'];
     } else {
         # not set.