public static function view($view, $itemID = null)
    {
        $baseViewsPath = self::getActiveTheme().'/views/'.$view;

        // General By ID: {template}-{ID}.blade.php
        $newView =  '-' . $itemID;
        if ($itemID && self::viewExists($view.$newView)) {
            return $baseViewsPath.$newView;
        }

        // Posts: {template}-{postSlug}.blade.php
        $newView =  '-' . Request::route('postSlug');
        if (Request::route('postSlug') && self::viewExists($view.$newView)) {
            return $baseViewsPath.$newView;
        }

        // Posts By Post Type: {template}-{postTypeSlug}-{postSlug}.blade.php
        $newView = Request::route('postTypeSlug').'-'.Request::route('postSlug');
        if (Request::route('postTypeSlug') && Request::route('postSlug') && self::viewExists($view.$newView)) {
            return $baseViewsPath.$newView;
        }

        // Authors: {template}-{authorSlug}.blade.php
        $newView = '-' . Request::route('authorSlug');
        if(Request::route('authorSlug') && self::viewExists($view.$newView)) {
            return $baseViewsPath.$newView;
        }

        // Tags:  {template}-{tagSlug}.blade.php
        $newView = Request::route('tagSlug');
        if (Request::route('tagSlug') && self::viewExists($view.$newView)) {
            return $baseViewsPath.$newView;
        }

        // Post Type: {template}-{postTypeSlug}.blade.php
        $newView = '-' . Request::route('postTypeSlug');
        if (Request::route('postTypeSlug') && self::viewExists($view.$newView)) {
            return $baseViewsPath.$newView;
        }

        // Category: {template}-{categorySlug}.blade.php
        $viewName = '-' . Request::route('categorySlug');
        if (Request::route('categorySlug') && self::viewExists($view.$viewName)) {
            return $baseViewsPath.$viewName;
        }

        return $baseViewsPath;
    }
public static function view($view, $itemID = null)
    {
        $baseViewsPath = self::getActiveTheme().'/views/'.$view;

        // General By ID: {template}-{ID}.blade.php
        $newView =  '-' . $itemID;
        if ($itemID && self::viewExists($view.$newView)) {
            return $baseViewsPath.$newView;
        }

        // Posts: {template}-{postSlug}.blade.php
        $newView =  '-' . Request::route('postSlug');
        if (Request::route('postSlug') && self::viewExists($view.$newView)) {
            return $baseViewsPath.$newView;
        }

        // Posts By Post Type: {template}-{postTypeSlug}-{postSlug}.blade.php
        $newView = Request::route('postTypeSlug').'-'.Request::route('postSlug');
        if (Request::route('postTypeSlug') && Request::route('postSlug') && self::viewExists($view.$newView)) {
            return $baseViewsPath.$newView;
        }

        // Authors: {template}-{authorSlug}.blade.php
        $newView = '-' . Request::route('authorSlug');
        if(Request::route('authorSlug') && self::viewExists($view.$newView)) {
            return $baseViewsPath.$newView;
        }

        // Tags:  {template}-{tagSlug}.blade.php
        $newView = Request::route('tagSlug');
        if (Request::route('tagSlug') && self::viewExists($view.$newView)) {
            return $baseViewsPath.$newView;
        }

        // Post Type: {template}-{postTypeSlug}.blade.php
        $newView = '-' . Request::route('postTypeSlug');
        if (Request::route('postTypeSlug') && self::viewExists($view.$newView)) {
            return $baseViewsPath.$newView;
        }

        // Category: {template}-{categorySlug}.blade.php
        $viewName = '-' . Request::route('categorySlug');
        if (Request::route('categorySlug') && self::viewExists($view.$viewName)) {
            return $baseViewsPath.$viewName;
        }

        return $baseViewsPath;
    }
public static function view ( $ view , $ itemID = null ) { $ baseViewsPath = self :: getActiveTheme ( ) . '/views/' . $ view ; // General By ID: {template}-{ID}.blade.php $ newView = '-' . $ itemID ; if ( $ itemID && self :: viewExists ( $ view . $ newView ) ) { return $ baseViewsPath . $ newView ; } // Posts: {template}-{postSlug}.blade.php $ newView = '-' . Request :: route ( 'postSlug' ) ; if ( Request :: route ( 'postSlug' ) && self :: viewExists ( $ view . $ newView ) ) { return $ baseViewsPath . $ newView ; } // Posts By Post Type: {template}-{postTypeSlug}-{postSlug}.blade.php $ newView = Request :: route ( 'postTypeSlug' ) . '-' . Request :: route ( 'postSlug' ) ; if ( Request :: route ( 'postTypeSlug' ) && Request :: route ( 'postSlug' ) && self :: viewExists ( $ view . $ newView ) ) { return $ baseViewsPath . $ newView ; } // Authors: {template}-{authorSlug}.blade.php $ newView = '-' . Request :: route ( 'authorSlug' ) ; if ( Request :: route ( 'authorSlug' ) && self :: viewExists ( $ view . $ newView ) ) { return $ baseViewsPath . $ newView ; } // Tags:  {template}-{tagSlug}.blade.php $ newView = Request :: route ( 'tagSlug' ) ; if ( Request :: route ( 'tagSlug' ) && self :: viewExists ( $ view . $ newView ) ) { return $ baseViewsPath . $ newView ; } // Post Type: {template}-{postTypeSlug}.blade.php $ newView = '-' . Request :: route ( 'postTypeSlug' ) ; if ( Request :: route ( 'postTypeSlug' ) && self :: viewExists ( $ view . $ newView ) ) { return $ baseViewsPath . $ newView ; } // Category: {template}-{categorySlug}.blade.php $ viewName = '-' . Request :: route ( 'categorySlug' ) ; if ( Request :: route ( 'categorySlug' ) && self :: viewExists ( $ view . $ viewName ) ) { return $ baseViewsPath . $ viewName ; } return $ baseViewsPath ; }
Get template view.

@param string $view   The name of view file
@param object $itemID Extra ID to perform additional check of view. ex {template}-{ID}

@return string Returns the template path of active theme
Get template view .