Renders a customer page.

@param string $action
The action route parameter.
@param string $id
The id route parameter.
357049
public function formPage($action = NULL, $id = NULL) {
    $plugin = $this->customerPagesManager->createInstance($this->customerPagesPlugin, ['action' => $action, 'id' => $id]);
    $form_state = new FormState();
    $form = $this->formBuilder->buildForm($plugin, $form_state);
    $form['#attached']['library'][] = 'core/jquery.form';
    $form['#attached']['library'][] = 'core/drupal.ajax';
    $form['#attached']['library'][] = 'acm_customer/single_page_app';
    $form['#attached']['drupalSettings']['acm_customer'] = [
      'customerPagesPath' => Url::fromRoute('acm_customer.view_page')->toString(),
      'ajaxCustomerPagesPath' => Url::fromRoute('acm_customer.ajax_view_page')->toString(),
    ];
    return $form;
  }
759486
public function actionView(string $id)
    {
        $model = $this->findModel($id);

        return $this->render('view', ['model' => $model]);
    }
239043
public function amOnAction($action, $params = [])
    {
        $route = $this->getRouteByAction($action);
        $absolute = !is_null($route->domain());
        $url = $this->app['url']->action($action, $params, $absolute);

        $this->amOnPage($url);
    }
1019247
protected function  o_annotation($id, $action, $options = '') {
    if  ($action !== 'new') {
      $o = & $this->objects[$id];
    }

    switch  ($action) {
    case  'new':
      // add the annotation to the current page
      $pageId =  $this->currentPage;
      $this->o_page($pageId, 'annot', $id);

      // and add the action object which is going to be required
      switch ($options['type']) {
      case  'link':
        $this->objects[$id] = array('t'=>'annotation', 'info'=>$options);
        $this->numObj++;
        $this->o_action($this->numObj, 'new', $options['url']);
        $this->objects[$id]['info']['actionId'] = $this->numObj;
        break;

      case  'ilink':
        // this is to a named internal link
        $label =  $options['label'];
        $this->objects[$id] = array('t'=>'annotation', 'info'=>$options);
        $this->numObj++;
        $this->o_action($this->numObj, 'new', array('type'=>'ilink', 'label'=>$label));
        $this->objects[$id]['info']['actionId'] = $this->numObj;
        break;
      }
      break;

    case  'out':
      $res = "\n$id 0 obj\n<< /Type /Annot";
      switch ($o['info']['type']) {
      case  'link':
      case  'ilink':
        $res.=  "\n/Subtype /Link";
        break;
      }
      $res.= "\n/A ".$o['info']['actionId']." 0 R";
      $res.= "\n/Border [0 0 0]";
      $res.= "\n/H /I";
      $res.= "\n/Rect [ ";

      foreach($o['info']['rect'] as  $v) {
        $res.=  sprintf("%.4F ", $v);
      }

      $res.= "]";
      $res.= "\n>>\nendobj";
      return  $res;
    }
  }
255927
public function renderAction(Action $action, array $parameters = []): Response
    {
        return $this->baseTemplatingHelper->renderAction($action, $parameters);
    }
1108081
public function actionShow($id) {
    $profile = Profile::find()->byId($id)->one();

    if ($profile === null) {
      throw new NotFoundHttpException();
    }

    return $this->render('show', [
      'profile' => $profile,
    ]);
  }
534066
public function actionView($id)
    {
        $model = $this->findModel($id);
        $model->updateCounters(['views' => 1]);
        return $this->render($model->view, [
            'model' => $model,
        ]);
    }
4502
public function actionView(int $id)
    {
        $model = $this->findModel($id);

        return $this->render('view', [
            'model' => $model,
            'usernameField' => $this->usernameField,
        ]);
    }
277297
public function deleteAction($id)
    {
        /** @var Menus_Entity_Table_Menu $table */
        $table = ORM::getTable($this->plugin, 'Menu');
        /** @var Menus_Entity_Menu $menu */
        $menu = $table->find($id);

        if (!is_null($menu))
        {
            $table->delete($menu);
        }
        HTTP::redirect(str_replace('&amp;', '&', $this->ui->url()));
    }
1205232
public static function add($action, $type, $id = null)
    {
        if (!is_null($id))
            self::$modelMap[$type][$id] = $action;
        else
            self::$typeMap[$type] = $action;
    }
1209897
public function updateAction(Request $request, $id)
        {

            /** @var Customer $oCustomer */
            $oCustomer = CustomerQuery::create()->findOneById($id);

            if (count($oCustomer) === 0) {
                throw $this->createNotFoundException('Unable to find Customer entity.');
            }

            $deleteForm = $this->createDeleteForm($id);
            $editForm   = $this->createEditForm($oCustomer);
            $editForm->handleRequest($request);


            if ($editForm->isValid()) {


                $sLogoPath = $this->_handleLogoUpload($request, $oCustomer);
                $oCustomer->setLogo($sLogoPath);

                $oCustomer->save();

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

            return $this->render('SlashworksAppBundle:Customer:edit.html.twig', array(
                'entity'      => $oCustomer,
                'edit_form'   => $editForm->createView(),
                'delete_form' => $deleteForm->createView(),
            ));
        }
864756
function performAction($controller,$action,$queryString = null,$render = 0) {
		$controllerFile = ROOT . '/application/controllers/' . $controller . "controller.php";
		//print "Trying to load $controllerFile<br>";
		if (file_exists($controllerFile)){
			//print "File exists<br>";
			include_once($controllerFile);
		} else {
			throw new Exception("Controller file: $controllerFile does not exists");
		}
		$controllerName = ucfirst($controller).'Controller';
		$actionName= $action . 'Action'; // This is done to avoid clash with reserved function names like list();
		if (class_exists($controllerName)){
			
		} else {
			throw new Exception("ControllerClass: $controllerName does not exists");
		}

		//print "Trying to load $controllerName<br>"; 
		$dispatch = new $controllerName($controller, $action);
		$dispatch->render = $render;
		$dispatch->$actionName($queryString);

		if ($dispatch->render >0) {
				$dispatch->display();
		}

	}
371278
public function renderListAction(
        Action $action,
        DataGrid $dataGrid,
        array $viewParameters = []
    ): Response {
        $viewParameters = array_merge(
            $this->getViewParameters($action),
            ['datagrid' => $dataGrid],
            $viewParameters
        );

        return $this->renderAction($action, $viewParameters);
    }
1256113
public function handleEdit(int $id = null, array $request = [])
    {
        if ($id === null) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('pages-list-page') . "?m=2");
            } else {
                return 'Redirect: ' . $this->router->generate('pages-list-page') . "?m=2";
            }
        }
        $page = $this->core->api('Page/' . $id, 'GET')->run();
        if ($page['headers'][0][2] === 422) {
            if (isset($_GET['template']) === false) {
                return redirect($this->router->generate('pages-list-page') . "?m=2");
            } else {
                return 'Redirect: ' . $this->router->generate('pages-list-page') . "?m=2";
            }
        } elseif (($page["headers"][0][2] - 200) * ($page["headers"][0][2] - 299) > 0) {
            if (headers_sent() === false) {
                foreach ($page["headers"] as $header) {
                    header($header[0], $header[1], $header[2]);
                }
            }
            return $this->templates->render("500", [
                "error" => $page['response'],
                "result" => ''
            ]);
        }
        $page = $page['response'];

        if (isset($request['byline']) === true && $request['byline'] === '') {
            unset($request['byline']);
        }
        if (isset($request['link']) === true && $request['link'] === '') {
            unset($request['link']);
        }
        if (isset($request['content']) === true && $request['content'] === '') {
            unset($request['content']);
        }
        if (isset($request['featured']) === true && $request['featured'] === '') {
            unset($request['featured']);
        }
        if (isset($request['tags']) === true && $request['tags'] === '') {
            unset($request['tags']);
        }
        if (isset($request['class']) === true && $request['class'] === '') {
            unset($request['class']);
        }
        if (isset($request['page_id']) === true && $request['page_id'] === '') {
            unset($request['page_id']);
        }
        $validator = new \Valitron\Validator($request);
        $validator->rule('required', ['title']);
        $validator->rule('optional', ['byline', 'content', 'link', 'tags', 'class', 'featured', 'page_id']);
        $validator->rule(function ($field, $value, array $params, array $fields) {
            return is_string($value);
        }, ['title', 'byline', 'content'])->message("{field} must be a string");
        $validator->rule(function ($field, $value, array $params, array $fields) {
            return file_exists(rtrim(public_path(), '/') . $value) || (filter_var($value, FILTER_VALIDATE_URL) !== false);
        }, 'featured')->message("{field} must be an external link or a local file path");
        $validator->rule(function ($field, $value, $params, $fields) {
            if (is_array($value) === true || preg_match('/[\w\-]+(,\s?[\w\-]+)*/', $value) === 1) {
                return true;
            }
            return false;
        }, ["tags", "class"])->message("{field} must be an array or comma-separated");
        $validator->rule(function ($field, $value, $params, $fields) {
            $page = Model\Page::find($value);
            if ($page === null) {
                return false;
            }
            return true;
        }, "page_id")->message("{field} must be child of a valid page");
        $validator->rule(function ($field, $value, $params, $fields) {
            $page = Model\Page::where('link', $value)->first();
            if ($page === null) {
                return true;
            }
            return false;
        }, "link")->message("{field} must be unique");
        if ($validator->validate() === false) {
            if (headers_sent() === false) {
                header('X-PHP-Response-Code: 422', true, 422);
            }
            $page = $this->core->api('Page/' . $id, 'GET')->run();
            $pages_list = $this->core->api('Page/all', 'GET')->run();
            return $this->templates->render("Main::Pages/Edit", [
                "messages" => [
                    'error' => $validator->errors(),
                    'info' => '',
                    'success' => '',
                    'warning' => ''
                ],
                "page" => $page['response'],
                "pages" => $pages_list['response']
            ]);
        }

        $response = [];
        if (empty($request['publish']) === false) {
            $request['status'] = 1;
            $response = $this->core->api('Page/' . $page->id, 'PUT')->run($request);
        } elseif (empty($request['draft']) === false) {
            $request['status'] = 0;
            $response = $this->core->api('Page/' . $page->id, 'PUT')->run($request);
        }

        if (headers_sent() === false) {
            foreach ($response["headers"] as $header) {
                header($header[0], $header[1], $header[2]);
            }
        }
        if ($response["headers"][0][2] === 422) {
            $page = $this->core->api('Page/' . $id, 'GET')->run();
            $pages_list = $this->core->api('Page/all', 'GET')->run();
            return $this->templates->render("Main::Pages/Edit", [
                "messages" => [
                    'error' => $response['response'],
                    'info' => '',
                    'success' => '',
                    'warning' => ''
                ],
                "page" => $page['response'],
                "pages" => $pages_list['response']
            ]);
        } elseif (($response["headers"][0][2] - 200) * ($response["headers"][0][2] - 299) <= 0) {
            $page = $this->core->api('Page/' . $id, 'GET')->run();
            $pages_list = $this->core->api('Page/all', 'GET')->run();
            return $this->templates->render("Main::Pages/Edit", [
                "messages" => [
                    'error' => '',
                    'info' => '',
                    'success' => 'Page updated successfully.',
                    'warning' => ''
                ],
                "page" => $page['response'],
                "pages" => $pages_list['response']
            ]);
        } else {
            return $this->templates->render("500", [
                "error" => $response['response'],
                "result" => ''
            ]);
        }
    }
741881
protected function execute($id, $action, $actionArg = null, $object = null, $class = null)
    {
        return $this->requestAction(RequestOps::EXECUTE, $action, $id, $actionArg, $object, $class);
    }
75419
public function showAction(Request $request, $id)
    {
        /** @var ConfiguratorFactory $configuratorFactory */
        $configuratorFactory = $this->getConfiguratorFactory($this->getClassName());
        /** @var CrudConfigurator $crudConfigurator */
        $crudConfigurator = $configuratorFactory->getConfigurator(CrudConfigurator::class);
        /* @var PageConfigurator $pageConfigurator */
        $pageConfigurator = $configuratorFactory->getConfigurator(PageConfigurator::class);
        /* @var GridConfigurator $gridConfigurator */
        $gridConfigurator = $configuratorFactory->getConfigurator(GridConfigurator::class);

        $this->isGrantedOr404Error($crudConfigurator, Constants::ACTION_READ);
        $crud = $crudConfigurator->getCrud();

        $translator = $this->get('translator');
        $translationDomain = $this->getParameter('symfonyid.admin.translation_domain');
        /** @var ModelInterface $model */
        $model = $this->findOr404Error($id);
        /** @var View $view */
        $view = $this->get('symfonyid.admin.view.view');
        $view->setParam('page_title', $translator->trans($pageConfigurator->getTitle(), array(), $translationDomain));
        $view->setParam('page_description', $translator->trans($pageConfigurator->getDescription(), array(), $translationDomain));

        $driver = $this->get('symfonyid.admin.manager.driver_finder')->findDriverForClass($crud->getModelClass());
        $crudFactory = $this->get('symfonyid.admin.crud.crud_factory');
        $crudFactory->setRequest($request);
        $crudFactory->setDriver($driver);
        $crudFactory->setView($view);
        $crudFactory->setTemplate($crudConfigurator->getTemplate()->getShow());
        $showFields = $crud->getShowFields() ?: $gridConfigurator->getColumns(new \ReflectionClass($crud->getModelClass()));

        return $crudFactory->showDetail($model, $showFields, $crud->isAllowDelete());
    }
372108
public function render($id)
    {
        $post = Post::find($id);

        View::make('Assely::Column/Taxonomy', [
            'terms' => $this->taxonomy->postTerms($post),
        ]);
    }