public function view($slug, $data = [])
    {
        if ($this->can_proceed()) {
            // As this is the correct route, apply middleware stack.
            $this->apply_middleware();

            // Passed all middleware.
            if ($this->can_proceed()) {
                do_action("snap_render_view_{$slug}", Container::get('request'), $data);
                
                View::render($slug, $data);

                $this->has_matched_route = true;

                echo \ob_get_clean();
            }
        }
    }
public function view($slug, $data = [])
    {
        if ($this->can_proceed()) {
            // As this is the correct route, apply middleware stack.
            $this->apply_middleware();

            // Passed all middleware.
            if ($this->can_proceed()) {
                do_action("snap_render_view_{$slug}", Container::get('request'), $data);
                
                View::render($slug, $data);

                $this->has_matched_route = true;

                echo \ob_get_clean();
            }
        }
    }
public function view ( $ slug , $ data = [ ] ) { if ( $ this -> can_proceed ( ) ) { // As this is the correct route, apply middleware stack. $ this -> apply_middleware ( ) ; // Passed all middleware. if ( $ this -> can_proceed ( ) ) { do_action ( "snap_render_view_{$slug}" , Container :: get ( 'request' ) , $ data ) ; View :: render ( $ slug , $ data ) ; $ this -> has_matched_route = true ; echo \ ob_get_clean ( ) ; } } }
Render a view and stop any other routes from processing.

@since  1.0.0

@param string $slug The slug of the view to render.
@param array  $data Array of data to apss to the view.
Render a view and stop any other routes from processing .