本文整理汇总了PHP中Sites::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Sites::update方法的具体用法?PHP Sites::update怎么用?PHP Sites::update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sites
的用法示例。
在下文中一共展示了Sites::update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editAction
public function editAction(Sites $site)
{
if ($this->request->isPost()) {
$data = $this->request->getPost();
// dd($data);
$site->update($data);
$this->redirectByRoute(['for' => 'sites.show', 'site' => $site->id]);
}
$this->view->site = $site;
$this->view->form = myForm::buildFormFromModel($site);
}
示例2: AdminPage
<?php
require_once "config.php";
require_once WWW_DIR . "/lib/adminpage.php";
require_once WWW_DIR . "/lib/site.php";
$page = new AdminPage();
$sites = new Sites();
$id = 0;
// set the current action
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';
switch ($action) {
case 'submit':
$site = $sites->update($_POST);
$returnid = $site->id;
header("Location:" . WWW_TOP . "/site-edit.php?id=" . $returnid);
break;
case 'view':
default:
$page->title = "Site Edit";
$site = $sites->get();
$page->smarty->assign('fsite', $site);
break;
}
$page->smarty->assign('yesno_ids', array(1, 0));
$page->smarty->assign('yesno_names', array('Yes', 'No'));
$page->smarty->assign('menupos_ids', array(1, 2));
$page->smarty->assign('menupos_names', array('Left', 'Top'));
$page->smarty->assign('newgroupscan_names', array('Days', 'Posts'));
$page->smarty->assign('registerstatus_ids', array(Sites::REGISTER_STATUS_OPEN, Sites::REGISTER_STATUS_INVITE, Sites::REGISTER_STATUS_CLOSED));
$page->smarty->assign('registerstatus_names', array('Open', 'Invite', 'Closed'));
$page->smarty->assign('passworded_ids', array(0, 1, 2));
示例3: AdminPage
<?php
require_once "config.php";
require_once WWW_DIR . "/lib/adminpage.php";
require_once WWW_DIR . "/lib/site.php";
require_once WWW_DIR . "/lib/sabnzbd.php";
$page = new AdminPage();
$sites = new Sites();
$id = 0;
// set the current action
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';
switch ($action) {
case 'submit':
$error = "";
$ret = $sites->update($_POST);
if (is_int($ret)) {
if ($ret == Sites::ERR_BADUNRARPATH) {
$error = "The unrar path does not point to a valid binary";
} elseif ($ret == Sites::ERR_BADFFMPEGPATH) {
$error = "The ffmpeg path does not point to a valid binary";
} elseif ($ret == Sites::ERR_BADMEDIAINFOPATH) {
$error = "The mediainfo path does not point to a valid binary";
} elseif ($ret == Sites::ERR_BADNZBPATH) {
$error = "The nzb path does not point to a valid directory";
} elseif ($ret == Sites::ERR_DEEPNOUNRAR) {
$error = "Deep password check requires a valid path to unrar binary";
} elseif ($ret == Sites::ERR_BADTMPUNRARPATH) {
$error = "The temp unrar path is not a valid directory";
} elseif ($ret == Sites::ERR_BADLAMEPATH) {
$error = "The lame path is not a valid directory";
} elseif ($ret == Sites::ERR_SABCOMPLETEPATH) {