本文整理汇总了PHP中Template_Controller::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP Template_Controller::redirect方法的具体用法?PHP Template_Controller::redirect怎么用?PHP Template_Controller::redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Template_Controller
的用法示例。
在下文中一共展示了Template_Controller::redirect方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* Méthode : page qui gère la sauvegarde ou le delete avec un renvois soit au détail ou listing
*/
public function save($type = FALSE, $idItem = FALSE)
{
if (($save = $this->input->post()) !== FALSE) {
if ($type == 'sauve' || $type == 'valid') {
$this->item->update($save, $idItem);
} elseif ($type == 'trash') {
$this->item->delete($idItem);
}
}
$url = 'items/show/' . $idItem;
if ($type == 'annul' || $type == 'valid' || $type == 'trash') {
$url = 'items';
}
return parent::redirect($url, $type);
}
示例2: save
/**
* Méthode : page qui gère la sauvegarde ou le delete avec un renvois soit au détail ou listing
*/
public function save($type = FALSE, $idActualite = FALSE)
{
if (($save = $this->input->post()) !== FALSE) {
if (isset($_POST['article'])) {
$save['article'] = stripslashes($_POST['article']);
}
if ($type == 'sauve' || $type == 'valid') {
$this->acticles->update($save, $idActualite);
} elseif ($type == 'trash') {
$this->acticles->delete($idActualite);
}
}
$url = 'articles/show/' . $idActualite;
if ($type == 'annul' || $type == 'valid' || $type == 'trash') {
$url = 'articles';
}
return parent::redirect($url, $type);
}
示例3: save
/**
* Méthode : page qui gère la sauvegarde ou le delete avec un renvois soit au détail ou listing
*/
public function save($type = FALSE, $idUser = FALSE)
{
if (($save = $this->input->post()) !== FALSE) {
if ($save['password']) {
$save['password'] = Auth::instance()->hash_password($save['password']);
} else {
unset($save['password']);
}
if ($save['role']) {
$role = new Roles_Model();
$role->deleteUser($idUser);
foreach ($save['role'] as $val) {
$role->insertUser($idUser, $val);
}
}
unset($save['role']);
if ($type == 'sauve' || $type == 'valid') {
$this->user->update($save, $idUser);
} elseif ($type == 'trash') {
$this->user->delete($idUser);
}
}
$url = 'users/show/' . $idUser;
if ($type == 'annul' || $type == 'valid' || $type == 'trash') {
$url = 'users';
}
return parent::redirect($url, $type);
}
示例4: save
/**
* Méthode : page qui gère la sauvegarde ou le delete avec un renvois soit au détail ou listing
*/
public function save($type = FALSE, $idQuete = FALSE)
{
if (($save = $this->input->post()) !== FALSE) {
if (isset($save['id_objet']) && $save['id_objet']) {
$save['id_objet'] = implode(',', $save['id_objet']);
}
if (isset($save['id_bot']) && $save['id_bot']) {
$save['id_bot'] = implode(',', $save['id_bot']);
}
if (isset($save['fonction']) && (trim($save['fonction']) == '' || $save['fonction'] == '<?php ?>')) {
$save['fonction'] = '';
}
if ($type == 'sauve' || $type == 'valid') {
$this->quete->update($save, $idQuete);
} elseif ($type == 'trash') {
$this->quete->delete($idQuete);
}
}
$url = 'quetes/show/' . $idQuete;
if ($type == 'annul' || $type == 'valid' || $type == 'trash') {
$url = 'quetes';
}
return parent::redirect($url, $type);
}
示例5: save
/**
* Méthode : page qui gère la sauvegarde ou le delete avec un renvois soit au détail ou listing
*/
public function save($type = FALSE, $idRegion = FALSE)
{
if (($save = $this->input->post()) !== FALSE) {
unset($save['json_actions_length']);
$map = Map_Model::instance();
if ($type == 'sauve' || $type == 'valid') {
$save['background_color'] = str_replace('#', '0x', $save['background_color']);
$save['ambiance'] = str_replace('#', '0x', $save['ambiance']);
$map->delete('( x > ' . $save['x'] . ' OR y > ' . $save['y'] . ' OR z > ' . $save['z'] . ' ) AND region_id = ' . $idRegion);
$this->region->update($save, $idRegion);
} elseif ($type == 'trash') {
if (($region = $this->region->select(array('id_parent' => $idRegion), 1)) !== FALSE) {
url::redirect('regions/show/' . $idRegion . '?msg=' . urlencode(Kohana::lang('region.yes_parent')));
}
$this->region->delete($idRegion);
}
}
$url = 'regions/show/' . $idRegion;
if ($type == 'annul' || $type == 'valid' || $type == 'trash') {
$url = 'regions';
if (isset($save['id_parent']) && $save['id_parent']) {
$url = 'regions/child/' . $save['id_parent'];
}
}
return parent::redirect($url, $type);
}