src/Loops/Service/WebCore.php
public function dispatch($url, Request $request, Response $response) {
        $output = $this->resolveOutput($url, $request->isAjax());

        if(is_object($output)) {
            if($output instanceof ElementInterface) {
                $response->addHeader("X-Loops-ID", $output->getLoopsId());
            }

            $output = $this->display($output, $request, $response);
        }

        $response->setHeader();

        return $output;
    }
public function dispatch($url, Request $request, Response $response) {
        $output = $this->resolveOutput($url, $request->isAjax());

        if(is_object($output)) {
            if($output instanceof ElementInterface) {
                $response->addHeader("X-Loops-ID", $output->getLoopsId());
            }

            $output = $this->display($output, $request, $response);
        }

        $response->setHeader();

        return $output;
    }
public function dispatch ( $ url , Request $ request , Response $ response ) { $ output = $ this -> resolveOutput ( $ url , $ request -> isAjax ( ) ) ; if ( is_object ( $ output ) ) { if ( $ output instanceof ElementInterface ) { $ response -> addHeader ( "X-Loops-ID" , $ output -> getLoopsId ( ) ) ; } $ output = $ this -> display ( $ output , $ request , $ response ) ; } $ response -> setHeader ( ) ; return $ output ; }
Dispatches a web request to an url and returns the contents to display

To generate the output, other resources are used such as the request service.

After the page element is resolved (see resolvePage method for detail) its action method is called to determine if the requests could be handled.
Depending on the result of the action method the output is generated.
Strings will be displayed as they are.
Integers will be used to create a Loops\ErrorPage object that is going to be displayed.
Returned objects will be displayed unless this is an ajax request, where the page object is going to be displayed instead.

The Loopsid of the finally selected object will be set in the response header as "X-Loops-ID"

@param string $url The accessed URL
@return string The content that should be displayed for this request.
Dispatches a web request to an url and returns the contents to display