src/View/SSViewer.php
protected function getSubtemplateFor($subtemplate)
    {
        // Get explicit subtemplate name
        if (isset($this->subTemplates[$subtemplate])) {
            return $this->subTemplates[$subtemplate];
        }

        // Don't apply sub-templates if type is already specified (e.g. 'Includes')
        if (isset($this->templates['type'])) {
            return null;
        }

        // Filter out any other typed templates as we can only add, not change type
        $templates = array_filter(
            (array)$this->templates,
            function ($template) {
                return !isset($template['type']);
            }
        );
        if (empty($templates)) {
            return null;
        }

        // Set type to subtemplate
        $templates['type'] = $subtemplate;
        return $templates;
    }
protected function getSubtemplateFor($subtemplate)
    {
        // Get explicit subtemplate name
        if (isset($this->subTemplates[$subtemplate])) {
            return $this->subTemplates[$subtemplate];
        }

        // Don't apply sub-templates if type is already specified (e.g. 'Includes')
        if (isset($this->templates['type'])) {
            return null;
        }

        // Filter out any other typed templates as we can only add, not change type
        $templates = array_filter(
            (array)$this->templates,
            function ($template) {
                return !isset($template['type']);
            }
        );
        if (empty($templates)) {
            return null;
        }

        // Set type to subtemplate
        $templates['type'] = $subtemplate;
        return $templates;
    }
protected function getSubtemplateFor ( $ subtemplate ) { // Get explicit subtemplate name if ( isset ( $ this -> subTemplates [ $ subtemplate ] ) ) { return $ this -> subTemplates [ $ subtemplate ] ; } // Don't apply sub-templates if type is already specified (e.g. 'Includes') if ( isset ( $ this -> templates [ 'type' ] ) ) { return null ; } // Filter out any other typed templates as we can only add, not change type $ templates = array_filter ( ( array ) $ this -> templates , function ( $ template ) { return ! isset ( $ template [ 'type' ] ) ; } ) ; if ( empty ( $ templates ) ) { return null ; } // Set type to subtemplate $ templates [ 'type' ] = $ subtemplate ; return $ templates ; }
Get the appropriate template to use for the named sub-template, or null if none are appropriate

@param string $subtemplate Sub-template to use

@return array|null
Get the appropriate template to use for the named sub - template or null if none are appropriate