本文整理匯總了PHP中Repositories\SiteRepository::editSlug方法的典型用法代碼示例。如果您正苦於以下問題:PHP SiteRepository::editSlug方法的具體用法?PHP SiteRepository::editSlug怎麽用?PHP SiteRepository::editSlug使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Repositories\SiteRepository
的用法示例。
在下文中一共展示了SiteRepository::editSlug方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: show
function show($id, Request $request, Application $app)
{
$this->build($id, $request, $app);
$siteQuotaRepository = new SiteQuotaRepository();
$userRepository = new UserAccountRepository();
$form = $app['form.factory']->create(new ActionForm());
if ('POST' == $request->getMethod()) {
$form->bind($request);
if ($form->isValid()) {
$data = $form->getData();
$action = new ActionParser($data['action']);
$sr = new SiteRepository();
if ($action->getCommand() == 'close') {
$this->parameters['site']->setIsClosedBySysAdmin(true);
$this->parameters['site']->setClosedBySysAdminreason($action->getParam(0));
$sr->edit($this->parameters['site'], $app['currentUser']);
return $app->redirect('/sysadmin/site/' . $this->parameters['site']->getId());
} else {
if ($action->getCommand() == 'open') {
$this->parameters['site']->setIsClosedBySysAdmin(false);
$this->parameters['site']->setClosedBySysAdminreason(null);
$sr->edit($this->parameters['site'], $app['currentUser']);
return $app->redirect('/sysadmin/site/' . $this->parameters['site']->getId());
} else {
if ($action->getCommand() == 'webrobots') {
$this->parameters['site']->setIsWebRobotsAllowed($action->getParamBoolean(0));
$sr->edit($this->parameters['site'], $app['currentUser']);
return $app->redirect('/sysadmin/site/' . $this->parameters['site']->getId());
} else {
if ($action->getCommand() == 'featuremap') {
$this->parameters['site']->setIsFeatureMap($action->getParamBoolean(0));
$sr->edit($this->parameters['site'], $app['currentUser']);
return $app->redirect('/sysadmin/site/' . $this->parameters['site']->getId());
} else {
if ($action->getCommand() == 'featuregroup') {
$this->parameters['site']->setIsFeatureGroup($action->getParamBoolean(0));
$sr->edit($this->parameters['site'], $app['currentUser']);
return $app->redirect('/sysadmin/site/' . $this->parameters['site']->getId());
} else {
if ($action->getCommand() == 'featureimporter') {
$this->parameters['site']->setIsFeatureImporter($action->getParamBoolean(0));
$sr->edit($this->parameters['site'], $app['currentUser']);
return $app->redirect('/sysadmin/site/' . $this->parameters['site']->getId());
} else {
if ($action->getCommand() == 'featurecuratedlist') {
$this->parameters['site']->setIsFeatureCuratedList($action->getParamBoolean(0));
$sr->edit($this->parameters['site'], $app['currentUser']);
return $app->redirect('/site/' . $this->parameters['site']->getId());
} else {
if ($action->getCommand() == 'featurephysicalevents') {
$this->parameters['site']->setIsFeaturePhysicalEvents($action->getParamBoolean(0));
$sr->edit($this->parameters['site'], $app['currentUser']);
return $app->redirect('/sysadmin/site/' . $this->parameters['site']->getId());
} else {
if ($action->getCommand() == 'featurevirtualevents') {
$this->parameters['site']->setIsFeatureVirtualEvents($action->getParamBoolean(0));
$sr->edit($this->parameters['site'], $app['currentUser']);
return $app->redirect('/sysadmin/site/' . $this->parameters['site']->getId());
} else {
if ($action->getCommand() == 'listedinindex') {
$this->parameters['site']->setIsListedInIndex($action->getParamBoolean(0));
$sr->edit($this->parameters['site'], $app['currentUser']);
return $app->redirect('/sysadmin/site/' . $this->parameters['site']->getId());
} else {
if ($action->getCommand() == 'quota') {
$sitequota = $siteQuotaRepository->loadByCode($action->getParam(0));
if ($sitequota) {
$this->parameters['site']->setSiteQuotaId($sitequota->getId());
$sr->editQuota($this->parameters['site'], $app['currentUser']);
return $app->redirect('/sysadmin/site/' . $this->parameters['site']->getId());
}
} else {
if ($action->getCommand() == 'newslug') {
$newslug = $action->getParam(0);
if (ctype_alnum($newslug) && strlen($newslug) > 1) {
$this->parameters['site']->setSlug($newslug);
$sr->editSlug($this->parameters['site'], $app['currentUser']);
return $app->redirect('/sysadmin/site/' . $this->parameters['site']->getId());
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
$this->parameters['form'] = $form->createView();
$this->parameters['sitequota'] = $this->parameters['site']->getSiteQuotaId() ? $siteQuotaRepository->loadById($this->parameters['site']->getSiteQuotaId()) : null;
return $app['twig']->render('sysadmin/site/show.html.twig', $this->parameters);
}