1.1 Creating opening tag navigation

@param string $id
@return string
337060
private function addOpeningNav(string $id): string
    {
        $output = '<nav ';
        if ($id !== '') $output .= 'id="' . $id . '" ';
        $output .= 'class="navbar navbar-' . $this->options['theme']['fore'];
        if (!empty($this->options['theme']['back'])) $output .= " bg-" . $this->options['theme']['back'];
        if ($this->options['mobile']) {
            $output .= ' navbar-expand-' . $this->options['mobileSize'];
        } else {
            $output .= ' navbar-expand';
        }
        if (!empty($this->options['theme']['color'])) $output .= '" style="background-color: #' . $this->options['theme']['color'];
        $output .= '">';
        return $output;
    }
409149
public static function nodePath($id)
    {
        $node = static::node($id);
        if (empty($node)) return '';

        if (empty($node->nodePath)) {
            $node->nodePath = static::nodePath($node->parent_id) . '/' . $node->slug;
        }
        return $node->nodePath;
    }
844874
public function editable($id): string
    {
        $attributes = [];
        $attributes['data-content-object']    = 'true';
        $attributes['data-content-object-id'] = $id;

        $attrParts = array();
        foreach ($attributes as $attrName => $attrValue) {
            $attrParts[] = sprintf('%s = "%s"', $attrName, $attrValue);
        }

        return ' ' . implode(' ', $attrParts);
    }
1018356
private function getDocumentPath(string $id): string
    {
        return $this->getDirectoryPath($id).'.'.$this->format->getExtension();
    }
948093
public function open($id, $mode = self::READ_MOD, $permission = self::DEFAULT_PERMISSIONS, $size = self::DEFAULT_SIZE)
    {
        return new Entry($id, $mode, $permission, $size);
    }
311384
public function view(string $id)
    {
        $dashboard = $this->Dashboards->get($id, [
            'contain' => [
                'Roles',
                'Widgets'
            ]
        ]);

        $query = $this->Dashboards->getUserDashboards($this->Auth->user());
        /**
         * @var \Search\Model\Table\WidgetsTable $widgetsTable
         */
        $widgetsTable = TableRegistry::get('Search.Widgets');

        $userDashboards = $query->find('list')->toArray();
        if (!array_key_exists($dashboard->id, $userDashboards)) {
            throw new ForbiddenException();
        }

        $widgets = [];

        foreach ($dashboard->get('widgets') as $k => $item) {
            $opts = $widgetsTable->getWidgetOptions($item);

            $x = (int)$opts['x'];
            $y = (int)$opts['y'];

            if (isset($widgets[$y][$x])) {
                $widgets[$y][] = $item;
            } else {
                $widgets[$y][$x] = $item;
            }
        }

        ksort($widgets);

        foreach ($widgets as $k => $items) {
            if (count($items) < 2) {
                continue;
            }

            usort($widgets[$k], function ($a, $b) {
                $opts_a = json_decode($a->widget_options, true);
                $opts_b = json_decode($b->widget_options, true);

                $x_a = (int)$opts_a['x'];
                $x_b = (int)$opts_b['x'];

                if ($x_a == $x_b) {
                    return 0;
                }

                return ($x_a < $x_b) ? -1 : 1;
            });
        }

        $this->set('dashboardWidgets', $widgets);
        $this->set('columns', Configure::readOrFail('Search.dashboard.columns'));
        $this->set('user', $this->Auth->user());
        $this->set('dashboard', $dashboard);
        $this->set('_serialize', ['dashboard']);
    }
691083
public function read($id) : string
    {
        if ($session = $this->walk('read', null, [$id])) {
            self::$session = $session;
            return self::$session['data'];
        }
        return '';
    }
409803
public function getView($id)
    {

        $model = (!empty($id) || $id === "0") ? $this->findAutoDetectTranslation($id) : $this->model;
        $form  = FormBuilder::create(get_class($this->form), [
            'model' => $model
        ]);

        $form_content = view('form-builder::form.components.formgenerator.info', [
            'form'  => $form,
            'id'    => $id,
            'route' => $this->getControllerNameForAction().'@',
        ]);

        $this->layoutManager->add([
            'content' => view('expendable::admin.form.state.form', [
                'form' => $form_content
            ])
        ]);

        return $this->layoutManager->render();

    }
721203
public function getPost($id)
	{
            $post = \App\Blog::find($id);
            if($post == NULL){
                App::abort(404);
            }
            return View('blog::post',array('title'=>$post['title'],'post'=>$post));
	}
45870
protected function get_edit_tour_link($id = null) {
        $addlink = helper::get_edit_tour_link($id);
        return \html_writer::link($addlink, get_string('newtour', 'tool_usertours'));
    }
14937
public function getById($id)
    {
        return new View(
            $this->getContext(),
            new ResourcePathServiceOperation($this->getContext(),$this->getResourcePath(),"getById",array($id))
        );
    }
1146660
public function edit($id)
    {
        $roles = Role::getAllLists();
        $navigation = NavigationAdmin::findOrFail($id);

        return $this->view('titan::settings.navigation.add_edit')
            ->with('item', $navigation)
            ->with('roles', $roles)
            ->with('parents', NavigationAdmin::getAllLists());
    }
48329
public function actionRnr($id)
    {
        $notification = $this->actionRead($id);
        return $this->redirect(Url::to($notification->getRoute()));
    }
1162258
public static function urlizeId($id)
    {
        if (is_array($id)) {
            $id = rawurlencode('('.self::flexiUrl($id).')');
        } else if (preg_match('/^ext:/', $id)) {
            $id = self::urlEncode($id);
        } else if (preg_match('/^code:/', $id)) {
            $id = self::code(self::urlEncode(self::uncode($id)));
        }
        return $id;
    }
651326
public function show($id)
    {
        $modelName = $this->modelFullName;
        $model = $modelName::find($id);
        if(!$model) throw new NotFoundException('There is no Resource with id = ' . $id . ' !');
        return $model;
    }
1335741
public function editAction($id)
    {
        $breadcumbs = $this->container->get('bacon_breadcrumbs');

        $breadcumbs->addItem(array(
            'title' => 'Language',
            'route' => 'admin_language',
        ));

        $breadcumbs->addItem(array(
            'title' => 'Edit',
            'route' => '',
        ));

        $entity = $this->getDoctrine()->getRepository('BaconLanguageBundle:Language')->find($id);

        if (!$entity) {

            $this->get('session')->getFlashBag()->add('message', array(
                'type' => 'error',
                'message' => 'The registry not Found',
            ));

            return $this->redirect($this->generateUrl('admin_language'));
        }

        $form = $this->createForm(new LanguageFormType(), $entity);
        $deleteForm = $this->createDeleteForm($id);

        return array(
            'entity'      => $entity,
            'form'        => $form->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
1179106
public function show($id)
    {
        $entry = $this->entriesRepository->getById($id, $this->resource);

        return view('laramanager::entries.show')
            ->with('resource', $this->resource)
            ->with('entry', $entry)
            ->with('objects', LaramanagerObject::all());
    }