public function isValid()
    {
        if ($this->get('page-template')->getValue() == 'blank') {
            $this->setValidationGroup(
                [
                    'url',
                    'title',
                    'main-layout',
                ]
            );
        } else {
            $this->setValidationGroup(
                [
                    'url',
                    'title',
                    'page-template',
                ]
            );
        }

        return parent::isValid();
    }
public function isValid()
    {
        if ($this->get('page-template')->getValue() == 'blank') {
            $this->setValidationGroup(
                [
                    'url',
                    'title',
                    'main-layout',
                ]
            );
        } else {
            $this->setValidationGroup(
                [
                    'url',
                    'title',
                    'page-template',
                ]
            );
        }

        return parent::isValid();
    }
public function isValid ( ) { if ( $ this -> get ( 'page-template' ) -> getValue ( ) == 'blank' ) { $ this -> setValidationGroup ( [ 'url' , 'title' , 'main-layout' , ] ) ; } else { $ this -> setValidationGroup ( [ 'url' , 'title' , 'page-template' , ] ) ; } return parent :: isValid ( ) ; }
Is Valid method for the new page form.  Adds a validation group
depending on if it's a new page or a copy of a template.

@return bool
Is Valid method for the new page form . Adds a validation group depending on if it s a new page or a copy of a template .