public static function setViewContext($context = null)
    {
        if ($context === null) {
            $context = self::get(self::get('app.views.context_param', 'format'), 
                                self::get('app.views.default_context', 'html'), 
                                self::get('request'));
        }
        
        self::set('app.view_context', $context);
        
        if (($viewContextParams = self::get("app.views.contexts.$context", false)) !== false) {
            if ($viewContextParams['layout'] !== true) {
                self::set('app.layout', $viewContextParams['layout']);
            }
            header('Content-type: ' . 
                self::get('content_type', 'text/html', $viewContextParams));
        }
    }
public static function setViewContext($context = null)
    {
        if ($context === null) {
            $context = self::get(self::get('app.views.context_param', 'format'), 
                                self::get('app.views.default_context', 'html'), 
                                self::get('request'));
        }
        
        self::set('app.view_context', $context);
        
        if (($viewContextParams = self::get("app.views.contexts.$context", false)) !== false) {
            if ($viewContextParams['layout'] !== true) {
                self::set('app.layout', $viewContextParams['layout']);
            }
            header('Content-type: ' . 
                self::get('content_type', 'text/html', $viewContextParams));
        }
    }
public static function setViewContext ( $ context = null ) { if ( $ context === null ) { $ context = self :: get ( self :: get ( 'app.views.context_param' , 'format' ) , self :: get ( 'app.views.default_context' , 'html' ) , self :: get ( 'request' ) ) ; } self :: set ( 'app.view_context' , $ context ) ; if ( ( $ viewContextParams = self :: get ( "app.views.contexts.$context" , false ) ) !== false ) { if ( $ viewContextParams [ 'layout' ] !== true ) { self :: set ( 'app.layout' , $ viewContextParams [ 'layout' ] ) ; } header ( 'Content-type: ' . self :: get ( 'content_type' , 'text/html' , $ viewContextParams ) ) ; } }
Sets the view context

View contexts are defined in app/views/contexts.
They can specify:
- an extension prefix (prefix)
- a layout (layout) (false disables the layout)
- an HTTP Content-Type (content_type)

@param string $context
Sets the view context