src/Sulu/Bundle/PageBundle/Command/ValidateWebspacesCommand.php
private function validateStructure($type, $template)
    {
        $valid = true;

        $metadata = $this->structureMetadataFactory->getStructureMetadata($type, $template);

        if (!$metadata) {
            throw new \RuntimeException(
                sprintf(
                    'Structure meta data not found for type "%s" and template "%s".',
                    $type,
                    $template
                )
            );
        }

        foreach (['title', 'url'] as $property) {
            if (!$metadata->hasProperty($property)) {
                throw new \RuntimeException(
                    sprintf(
                        'No property "%s" found in "%s" template.',
                        $property,
                        $metadata->getName()
                    )
                );
            }
        }

        $this->validateTwigTemplate($metadata->getView() . '.html.twig');
        $this->validateControllerAction($metadata->getController());

        return $valid;
    }
private function validateStructure($type, $template)
    {
        $valid = true;

        $metadata = $this->structureMetadataFactory->getStructureMetadata($type, $template);

        if (!$metadata) {
            throw new \RuntimeException(
                sprintf(
                    'Structure meta data not found for type "%s" and template "%s".',
                    $type,
                    $template
                )
            );
        }

        foreach (['title', 'url'] as $property) {
            if (!$metadata->hasProperty($property)) {
                throw new \RuntimeException(
                    sprintf(
                        'No property "%s" found in "%s" template.',
                        $property,
                        $metadata->getName()
                    )
                );
            }
        }

        $this->validateTwigTemplate($metadata->getView() . '.html.twig');
        $this->validateControllerAction($metadata->getController());

        return $valid;
    }
private function validateStructure ( $ type , $ template ) { $ valid = true ; $ metadata = $ this -> structureMetadataFactory -> getStructureMetadata ( $ type , $ template ) ; if ( ! $ metadata ) { throw new \ RuntimeException ( sprintf ( 'Structure meta data not found for type "%s" and template "%s".' , $ type , $ template ) ) ; } foreach ( [ 'title' , 'url' ] as $ property ) { if ( ! $ metadata -> hasProperty ( $ property ) ) { throw new \ RuntimeException ( sprintf ( 'No property "%s" found in "%s" template.' , $ property , $ metadata -> getName ( ) ) ) ; } } $ this -> validateTwigTemplate ( $ metadata -> getView ( ) . '.html.twig' ) ; $ this -> validateControllerAction ( $ metadata -> getController ( ) ) ; return $ valid ; }
Is template valid.

@param string $type
@param string $template

@return bool

@throws \Exception
Is template valid .