concrete/src/Asset/Asset.php
protected static function getAssetContentsByRoute($route)
    {
        $result = null;
        try {
            $app = Application::getFacadeApplication();
            $router = $app->make(RouterInterface::class);
            $context = new RequestContext();
            $context->fromRequest($app->make(Request::class));
            $context->setMethod('GET');
            $matched = $router->getRouteByPath($route, $context);
            $controller = $matched->getAction();
            $callable = null;
            if (is_string($controller)) {
                $chunks = explode('::', $controller, 2);
                if (count($chunks) === 2) {
                    if (class_exists($chunks[0])) {
                        $array = [$app->make($chunks[0]), $chunks[1]];
                        if (is_callable($array)) {
                            $callable = $array;
                        }
                    }
                } else {
                    if (class_exists($controller) && method_exists($controller, '__invoke')) {
                        $callable = $app->make($controller);
                    }
                }
            } elseif (is_callable($controller)) {
                $callable = $controller;
            }
            if ($callable !== null) {
                ob_start();
                $r = call_user_func($callable, false);
                if ($r instanceof Response) {
                    $result = $r->getContent();
                } elseif ($r !== false) {
                    $result = ob_get_contents();
                }
                ob_end_clean();
            }
        } catch (Exception $x) {
        }

        return $result;
    }
protected static function getAssetContentsByRoute($route)
    {
        $result = null;
        try {
            $app = Application::getFacadeApplication();
            $router = $app->make(RouterInterface::class);
            $context = new RequestContext();
            $context->fromRequest($app->make(Request::class));
            $context->setMethod('GET');
            $matched = $router->getRouteByPath($route, $context);
            $controller = $matched->getAction();
            $callable = null;
            if (is_string($controller)) {
                $chunks = explode('::', $controller, 2);
                if (count($chunks) === 2) {
                    if (class_exists($chunks[0])) {
                        $array = [$app->make($chunks[0]), $chunks[1]];
                        if (is_callable($array)) {
                            $callable = $array;
                        }
                    }
                } else {
                    if (class_exists($controller) && method_exists($controller, '__invoke')) {
                        $callable = $app->make($controller);
                    }
                }
            } elseif (is_callable($controller)) {
                $callable = $controller;
            }
            if ($callable !== null) {
                ob_start();
                $r = call_user_func($callable, false);
                if ($r instanceof Response) {
                    $result = $r->getContent();
                } elseif ($r !== false) {
                    $result = ob_get_contents();
                }
                ob_end_clean();
            }
        } catch (Exception $x) {
        }

        return $result;
    }
protected static function getAssetContentsByRoute ( $ route ) { $ result = null ; try { $ app = Application :: getFacadeApplication ( ) ; $ router = $ app -> make ( RouterInterface :: class ) ; $ context = new RequestContext ( ) ; $ context -> fromRequest ( $ app -> make ( Request :: class ) ) ; $ context -> setMethod ( 'GET' ) ; $ matched = $ router -> getRouteByPath ( $ route , $ context ) ; $ controller = $ matched -> getAction ( ) ; $ callable = null ; if ( is_string ( $ controller ) ) { $ chunks = explode ( '::' , $ controller , 2 ) ; if ( count ( $ chunks ) === 2 ) { if ( class_exists ( $ chunks [ 0 ] ) ) { $ array = [ $ app -> make ( $ chunks [ 0 ] ) , $ chunks [ 1 ] ] ; if ( is_callable ( $ array ) ) { $ callable = $ array ; } } } else { if ( class_exists ( $ controller ) && method_exists ( $ controller , '__invoke' ) ) { $ callable = $ app -> make ( $ controller ) ; } } } elseif ( is_callable ( $ controller ) ) { $ callable = $ controller ; } if ( $ callable !== null ) { ob_start ( ) ; $ r = call_user_func ( $ callable , false ) ; if ( $ r instanceof Response ) { $ result = $ r -> getContent ( ) ; } elseif ( $ r !== false ) { $ result = ob_get_contents ( ) ; } ob_end_clean ( ) ; } } catch ( Exception $ x ) { } return $ result ; }
Get the contents of an asset given its route.

@param string $route

@return string|null
Get the contents of an asset given its route .