Treat this method as a controller action.
Return view() or other content to display.
160667
public function run()
    {
        $count = Voyager::model('Post')->count();
        $string = $count == 1 ? '帖子' : '帖子';

        return view('voyager::dimmer', array_merge($this->config, [
            'icon'   => 'voyager-group',
            'title'  => "{$count} {$string}",
            'text'   => "当前共有 {$count} 条{$string}数据.",
            'button' => [
                'text' => '查看所有帖子',
                'link' => route('voyager.posts.index'),
            ],
            'image' => url(config('voyager.assets_path').'/images/widget-backgrounds/03.png'),
        ]));
    }
562210
function view() {
    var _this = this;

    var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;

    index = Number(index) || 0;

    if (!this.isShown) {
      this.index = index;
      return this.show();
    }

    if (this.hiding || this.played || index < 0 || index >= this.length || this.viewed && index === this.index) {
      return this;
    }

    if (this.viewing) {
      this.viewing.abort();
    }

    var element = this.element,
        options = this.options,
        title = this.title,
        canvas = this.canvas;

    var item = this.items[index];
    var img = item.querySelector('img');
    var url = getData(img, 'originalUrl');
    var alt = img.getAttribute('alt');
    var image = document.createElement('img');

    image.src = url;
    image.alt = alt;

    if (isFunction(options.view)) {
      addListener(element, EVENT_VIEW, options.view, {
        once: true
      });
    }

    if (dispatchEvent(element, EVENT_VIEW, {
      originalImage: this.images[index],
      index: index,
      image: image
    }) === false || !this.isShown || this.hiding || this.played) {
      return this;
    }

    this.image = image;
    removeClass(this.items[this.index], CLASS_ACTIVE);
    addClass(item, CLASS_ACTIVE);
    this.viewed = false;
    this.index = index;
    this.imageData = {};
    addClass(image, CLASS_INVISIBLE);

    if (options.loading) {
      addClass(canvas, CLASS_LOADING);
    }

    canvas.innerHTML = '';
    canvas.appendChild(image);

    // Center current item
    this.renderList();

    // Clear title
    title.innerHTML = '';

    // Generate title after viewed
    var onViewed = function onViewed() {
      var imageData = _this.imageData;


      title.textContent = alt + ' (' + imageData.naturalWidth + ' \xD7 ' + imageData.naturalHeight + ')';
    };
    var onLoad = void 0;

    addListener(element, EVENT_VIEWED, onViewed, {
      once: true
    });

    this.viewing = {
      abort: function abort() {
        removeListener(element, EVENT_VIEWED, onViewed);

        if (image.complete) {
          if (this.imageRendering) {
            this.imageRendering.abort();
          } else if (this.imageInitializing) {
            this.imageInitializing.abort();
          }
        } else {
          removeListener(image, EVENT_LOAD, onLoad);

          if (this.timeout) {
            clearTimeout(this.timeout);
          }
        }
      }
    };

    if (image.complete) {
      this.load();
    } else {
      addListener(image, EVENT_LOAD, onLoad = this.load.bind(this), {
        once: true
      });

      if (this.timeout) {
        clearTimeout(this.timeout);
      }

      // Make the image visible if it fails to load within 1s
      this.timeout = setTimeout(function () {
        removeClass(image, CLASS_INVISIBLE);
        _this.timeout = false;
      }, 1000);
    }

    return this;
  }
49010
protected function initViewContentBlocks($view)
    {
        $view->setBlock(
            'content',
            $this->getRequest()->getControllerName() . '/' . $this->getRequest()->getActionName()
        );

        return $view;
    }
765381
protected function _getFormView($view = null)
    {
        if (empty($view) && Arr::in($this->request->getParam('action'), $this->_formActions)) {
            $view = $this->_findViewByRequest();
        }

        return $view;
    }
1214174
public function view()
    {
        $this->set('title', $this->title);
        $this->set('buttonText', $this->buttonText);
        $this->set('baseSearchPath', $this->baseSearchPath);
        $this->set('postTo_cID', $this->postTo_cID);

        if ((string) $this->resultsURL !== '') {
            $resultsPage = null;
            $resultsURL = $this->resultsURL;
        } else {
            $resultsPage = $this->postTo_cID ? Page::getById($this->postTo_cID) : null;
            if (is_object($resultsPage) && !$resultsPage->isError()) {
                $resultsURL = $resultsPage->getCollectionPath();
            } else {
                $resultsPage = null;
                $c = Page::getCurrentPage();
                $resultsURL = $c->getCollectionPath();
            }
        }

        $resultsURL = $this->app->make('helper/text')->encodePath($resultsURL);

        $this->set('resultTargetURL', $resultsURL);
        if ($resultsPage !== null) {
            $this->set('resultTarget', $resultsPage);
        } else {
            $this->set('resultTarget', $resultsURL);
        }

        //run query if display results elsewhere not set, or the cID of this page is set
        if ($resultsPage === null && (string) $this->resultsURL === '') {
            if ((string) $this->request->request('query') !== '' || $this->request->request('akID') || $this->request->request('month')) {
                $this->do_search();
            }
        }
    }
167300
private function runView(): void
    {
        $action = ($this->routeAction) ? $this->routeAction : 'index';

        \call_user_func([$this->view, $action]);
    }
867776
private function execute()
	{
		if ($this->currentRoute == null) {
			$this->router->getRoute('error_page')->setAction('_notFound');
			$this->toRoute('error_page');
			return;
		}
		$controllerName = $this->currentRoute->getController();
		if ($controllerName == '') {
			if ($this->currentRoute->getParams() != null && array_key_exists('controller', $this->currentRoute->getParams()))
				$controllerName = $this->currentRoute->getParams()['controller'];
			elseif ($this->currentRoute->getDefault() != null)
				$controllerName = $this->currentRoute->getDefault()->getController();
			else {
				throw new \Exception($this->translator->translate("The requested url has a bad route configuration!"));
			}
		}

		if (array_key_exists($controllerName, $this->invokable))
			$controllerName = $this->invokable[$controllerName];
		elseif (strpos($controllerName, 'decoy\base') === false)
			throw new \Exception('The requested Controller: \'' . $controllerName . '\' is not registered!');
		$c = new $controllerName($this);
		if ($c->getResult() && !in_array($c->identifier, $this->disableRender) && $this->enableRender) {
			echo $this->response->output($c);
		}
	}
1021206
public function render() {
        global $controller;        
        
        if(!$this->ctrl) throw new \Exception('Controller not initialised');
        
		$controller = $this->ctrl;
        $this->ctrl->pageHeader();
        
        echo $this->renderContent();
    }
1027774
public function indexAction()
    {
        if (!$this->rcmUserService->isAllowed(ResourceName::RESOURCE_SITES, 'admin')) {
            $this->getResponse()->setStatusCode(Response::STATUS_CODE_401);

            return $this->getResponse();
        }

        $this->layout()->setTemplate('layout/blank');

        $view = new ViewModel();
        $view->setVariable(
            'siteSettingsSectionDefinitions',
            $this->getSettingsSectionDefinitions->__invoke()
        );

        return $view;
    }
471604
public function usageAction()
    {
        $this->assign('version', Samurai::getVersion());
        $this->assign('state', Samurai::getState());
        $this->assign('script', './app');   // TODO: $this->request->getScript()
        return self::VIEW_TEMPLATE;
    }
651909
public function render($action = null)
    {
        $action = is_null($action) ? $this->controller->action : $action;
        if (strpos($action, '/') === false) {
            $view_filename = VIEWS_DIR . $this->controller->name . '/' . $action . static::$ext;
        } else {
            $view_filename = VIEWS_DIR . $action . static::$ext;
        }
        $content = static::extract($view_filename, $this->vars);
        $this->controller->output .= $content;
    }
1338762
public function getView() : View
    {
        if (empty($this->view)) {
            $this->setView(new AppView());
        }

        return $this->view;
    }
189602
public function showAction()
    {
        $id = (int) $this->params()->fromRoute('id', null);

        $service = $this->getService();
        $entity  = $service->getById($id);

        return new ViewModel(array(
            'entity'  => $entity,
            'options' => $this->getOptions(),
        ));
    }
1185197
def get_view(cls, method_name):
        
        method = getattr(cls, method_name)

        @wraps(method)
        def view(request, **kwargs):
            handler = cls(request, kwargs)
            handler.call_processors('view')
            response = None
            try:
                response = method(handler)
                return response
            finally:
                handler.call_processors('post_view', response=response)

        return view
1311646
public function view($view = null)
    {
        if (null === $view) {
            return $this->view;
        }

        $this->view = $view;

        return $this;
    }
392556
public function output($view = null, $return = false) {
        if ($view instanceof View) {
            $this->view = $view;
        } else if (is_string($view) || is_bool($view) || is_numeric($view)) {
            $this->view = new SimpleView ($view);
        } else if (is_array($view)) {
            $this->view = new JsonView ($view);
        } else if (is_object($view)) {
            $this->view = new JsonView (get_object_vars($view));
        }

        if ($this->view instanceof View) {
            if ($return) {
                $content = $this->view->render();

                return $content;
            } else {
                $this->view->echoHeader();
                $content = $this->view->render();
                if (is_string($content) && $content) {
                    $content = apply_filter('before_output_content', $content, $this->view);
                    echo $content;
                }
            }
        } else if (!$return) {
            Response::respond(404);
        }

        return null;
    }
1374479
public static function view($url, $view, $data = null)
    {
        $callback = function () use ($view, $data) {
            $view = view($view);

            if (!is_null($data)) {
                foreach ($data as $key => $value) {
                    $view = $view->with($key, $value);
                }
            }

            return $view;
        };

        static::get($url, $callback);
    }