Show resource.

@param  $menu
@param  $model

@return Redirect
967180
public function show($menu = null, $model = null)
    {
        return Redirect::route('admin.menus.menulinks.edit', [$menu->id, $model->id]);
    }
1321436
public function onMenuChange(Menu $menu) : void
    {
        $this->aliasManager->invalidate(['site_id' => $menu->getSiteId()]);
        $this->aliasCacheLookup->refresh();
    }
1374758
public function store($menu = null, FormRequest $request)
    {
        $data = $request->all();
        $data['parent_id'] = null;
        $data['page_id'] = $data['page_id'] ?: null;
        $data['position'] = $data['position'] ?: 0;
        $model = $this->repository->create($data);

        return $this->redirect($request, $model);
    }
731131
public function menuAction()
    {
        $params     = $this->params();
        $navigation = $this->getServiceLocator()
                           ->get( 'Grid\Menu\Model\Menu\Model' )
                           ->findNavigation( $params->fromRoute( 'id' ) );

        $view = new ViewModel( array(
            'navigation' => $navigation,
        ) );

        $this->getResponse()
             ->getHeaders()
             ->addHeaderLine( 'Content-Type', 'application/xml' );

        return $view->setTerminal( true );
    }
1342365
protected function commonAction($model, $redirectUrl, $view)
    {
        $request = Yii::$app->getRequest();

        if ($request->getIsPost() && $this->repository->save($model, $request->post())) {
            return $this->redirect($redirectUrl);
        }

        return $this->render($view, \compact('model'));
    }
213222
public static function link($menu, $text, array $options = [], array $fields = [])
    {
        if ($menu instanceof ActiveRecord) {

            if (!$fields) {
                $fields = self::$fields;
            }

            if ($menu->{$fields['page_blank']}) {
                $options['target'] = '_blank';
            }

            return Html::a($text, self::linkUrl(
                $menu->{$fields['page_id']},
                $menu->{$fields['page_url']}
            ), $options);
        }

        return false;
    }
359076
public function show($id)
    {
      if ( \Auth::user()->roles[0]->can('menu-read' ) ) {
        $menu = $this->menus->findOrFail($id);
        return view('admin.menus.show', compact('menu'));
      }
      return \Redirect::route('admin.menus.index')->withErrors(trans('acl::dashboard.unauthorized_access'));
    }
196372
public function renderMenu($menu, $nodesList)
    {
        $menuManger = $this->getContainer()->get('compo_menu.manager');

        foreach ($nodesList as $key => $item) {
            /** @var \Compo\MenuBundle\Entity\MenuItem $nodeItem */
            $nodeItem = $item['node'];

            if (!$nodeItem->getEnabled()) {
                unset($nodesList[$key]);
                continue;
            }

            $targetId = $nodeItem->getTargetId();
            $type = $nodeItem->getType();

            if ('url' !== $type && $targetId) {
                $menuType = $menuManger->getMenuType($type);

                $menuType->fillMenuItem($item);
            } else {
                $nodeItem->setType('url');
                $item['url'] = $nodeItem->getUrl();
            }

            $item['node'] = $nodeItem;

            $image = $nodeItem->getImage();

            if ($image) {
                $item['image'] = $image;
            } else {
                $item['image'] = null;
            }

            /** @var MenuItem $node */
            $node = $menu->addChild($item['id'], ['uri' => $item['url']]);

            if ($item['url'] === $this->getRequest()->getRequestUri()) {
                // URL's completely match
                $node->setCurrent(true);
            } elseif ($item['url'] && $item['url'] !== $this->getRequest()->getBaseUrl() . '/' && (0 === mb_strpos($this->getRequest()->getRequestUri(), $item['url']))) {
                // URL isn't just "/" and the first container of the URL match
                $node->setCurrent(true);
            }

            if (\count($item['__children'])) {
                $item['__children'] = $this->renderMenu($node, $item['__children']);
            }

            $nodesList[$key] = $item;
        }

        return $nodesList;
    }
1171233
public static function view($path, $model = null) {
        if (($viewPath = PathUtility::getViewFilePath($path)) !== false) {
            $viewResult = new ViewResult($viewPath, $model);
            $viewContext = InternalHelper::makeViewContext(
                $viewPath, 
                self::$viewContext,
                $viewResult,
                $model,
                null,
                self::$parentActionViewContext,
                self::$viewContext,
                null
            );

            return $viewContext->content; //InternalHelper::getViewContent($viewPath, self::$viewContext, $model);
        }
        else {
            throw new ViewNotFoundException($path);
        }
    }
1177100
public function create(Model $model, $type = null)
    {
        $this->breadcrumb->onCreate($type);
        $form = $this->getForm($model, $type)->onCreate();

        return $this->view('create', ['form' => $form]);
    }
1029067
public function update(Request $request, Menu $menu)
    {
        $menu->parent_id = $request->get('parent_id');
        $menu->title = $request->get('title');
        $menu->icon = $request->get('icon');
        $menu->permission_id = $request->get('permission_id');

        if ($menu->permission_id == null) {
            $menu->uri = null;
        }
        else {
            $menu->uri = $menu->permission->uri;
        }

        $menu->save() ? admin_toastr('修改成功') : admin_toastr('修改失败', 'danger');

        return redirect()->route('admin::menu.index');
    }
609094
protected function redirectPreview($type, $model)
    {
        $params = [];
        $params['type'] = $type;
        $params['id'] = $model->id;
        \Staq\Util::httpRedirectUri(\Staq::App()->getUri($this, 'preview', $params));
    }
450829
public function show($id)
    {
        try {
            $category = $this->repository->findById($id);

            return $this->view('categories.show', compact('category'));
        } catch (ModelNotFoundException $e) {
            return $this->redirectNotFound();
        }
    }
223456
public function render(Model $model, $source)
    {
        $attachment = $this->resolveModelSource($model, $source);

        if ( ! ($attachment instanceof AttachmentInterface)) {
            return null;
        }

        return $attachment->url();
    }
1109168
public function showAction()
    {
        $this->setPageTitle(sprintf($this->_('Show %s'), $this->getTopic()));

        $model    = $this->getModel();
        // NEAR FUTURE:
        // $this->addSnippet('ModelVerticalTableSnippet', 'model', $model, 'class', 'displayer');
        $repeater = $model->loadRepeatable();
        $table    = $this->getShowTable();
        $table->setOnEmpty(sprintf($this->_('Unknown %s.'), $this->getTopic(1)));
        $table->setRepeater($repeater);
        $table->tfrow($this->createMenuLinks($this->menuShowIncludeLevel), array('class' => 'centerAlign'));

        if ($menuItem = $this->findAllowedMenuItem('edit')) {
            $table->tbody()->onclick = array('location.href=\'', $menuItem->toHRefAttribute($this->getRequest()), '\';');
        }

        $tableContainer = \MUtil_Html::create('div', array('class' => 'table-container'), $table);
        $this->html[] = $tableContainer;
    }
1202864
public function updateMenus(ServerRequestInterface $request): ResponseInterface
    {
        $modules = $this->module_service->findByInterface(ModuleMenuInterface::class, true);

        $this->updateStatus($modules, $request);
        $this->updateOrder($modules, 'menu_order', $request);
        $this->updateAccessLevel($modules, ModuleMenuInterface::class, $request);

        return redirect(route('menus'));
    }
844511
public function showAction()
    {
        $this->html->h2($this->getTopicTitle());

        $context = $this->_getParam('id', 'gems');
        $this->_upgrades->setContext($context);
        if ($info = $this->_upgrades->getUpgradesInfo($context)) {
            $this->html->table(array('class'=>'browser'))->tr()
                ->th($this->_('Context'))->td($info['context'])
                ->tr()
                ->th($this->_('Level'))->td($info['level']);
            $data = $this->_upgrades->getUpgrades();
            foreach($data as $level => $row) {
                foreach($this->menu->getCurrent()->getChildren() as $menuItem) {
                    if ($menuItem->is('allowed', true)) {
                        $show = true;
                        if ($level <= $info['level'] && $menuItem->is('action','execute-to')) {
                            //When this level is < current level don't allow to execute from current level to this one
                            $show = false;
                        }
                        if ($level <= $info['level'] && $menuItem->is('action','execute-from')) {
                            //When this level is < current level don't allow to execute from current level to this one
                            $show = false;
                        }
                        if ($show) {
                            $row['action'][] = $menuItem->toActionLinkLower($this->getRequest(), $row, array('from'=>$level, 'to'=>$level));
                        }
                    }
                }
                $row['level'] = $level;
                $data[$level] = $row;
            }
            $displayColumns = array('level' => $this->_('Level'),
                                    'info'   => $this->_('Description'),
                                    'action' => $this->_('Action'));
            $this->addSnippet('SelectiveTableSnippet', 'data', $data, 'class', 'browser', 'columns', $displayColumns);
        } else {
            $this->html[] = sprintf($this->_('Context %s not found!'), $context);
        }

        if ($parentItem = $this->menu->getCurrent()->getParent()) {
            $this->html[] = $parentItem->toActionLink($this->getRequest(), $this->_('Cancel'));
        }
    }