public function viewModeList($viewMode)
    {
        $this->_validateViewMode($viewMode);
        $this->loadModel('Field.FieldInstances');
        $instances = $this->_getInstances();

        if (count($instances) === 0) {
            $this->Flash->warning(__d('field', 'There are no field attached yet.'));
        } else {
            $instances = $instances->sortBy(function ($fieldInstance) use ($viewMode) {
                if (isset($fieldInstance->view_modes[$viewMode]['ordering'])) {
                    return $fieldInstance->view_modes[$viewMode]['ordering'];
                }

                return 0;
            }, SORT_ASC);
        }

        $this->title(__d('field', 'View Modes'));
        $this->set('instances', $instances);
        $this->set('viewMode', $viewMode);
        $this->set('viewModeInfo', $this->viewModes($viewMode));
    }
public function viewModeList($viewMode)
    {
        $this->_validateViewMode($viewMode);
        $this->loadModel('Field.FieldInstances');
        $instances = $this->_getInstances();

        if (count($instances) === 0) {
            $this->Flash->warning(__d('field', 'There are no field attached yet.'));
        } else {
            $instances = $instances->sortBy(function ($fieldInstance) use ($viewMode) {
                if (isset($fieldInstance->view_modes[$viewMode]['ordering'])) {
                    return $fieldInstance->view_modes[$viewMode]['ordering'];
                }

                return 0;
            }, SORT_ASC);
        }

        $this->title(__d('field', 'View Modes'));
        $this->set('instances', $instances);
        $this->set('viewMode', $viewMode);
        $this->set('viewModeInfo', $this->viewModes($viewMode));
    }
public function viewModeList ( $ viewMode ) { $ this -> _validateViewMode ( $ viewMode ) ; $ this -> loadModel ( 'Field.FieldInstances' ) ; $ instances = $ this -> _getInstances ( ) ; if ( count ( $ instances ) === 0 ) { $ this -> Flash -> warning ( __d ( 'field' , 'There are no field attached yet.' ) ) ; } else { $ instances = $ instances -> sortBy ( function ( $ fieldInstance ) use ( $ viewMode ) { if ( isset ( $ fieldInstance -> view_modes [ $ viewMode ] [ 'ordering' ] ) ) { return $ fieldInstance -> view_modes [ $ viewMode ] [ 'ordering' ] ; } return 0 ; } , SORT_ASC ) ; } $ this -> title ( __d ( 'field' , 'View Modes' ) ) ; $ this -> set ( 'instances' , $ instances ) ; $ this -> set ( 'viewMode' , $ viewMode ) ; $ this -> set ( 'viewModeInfo' , $ this -> viewModes ( $ viewMode ) ) ; }
View modes.

Shows the list of fields for corresponding view mode.

@param string $viewMode View mode slug. e.g. `rss` or `default`
@return void
@throws \Cake\Network\Exception\NotFoundException When given view mode
does not exists
View modes .