本文整理汇总了PHP中Request::req方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::req方法的具体用法?PHP Request::req怎么用?PHP Request::req使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Request
的用法示例。
在下文中一共展示了Request::req方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: signSet
private static function signSet()
{
$bd = new BaseDatos();
$email = Request::req("email");
$clave = Request::req("clave");
$alias = Request::req("alias");
$date = date('Y-m-d h:i:s');
$activo = 1;
$personal = 0;
$administrador = 0;
//-----------------------------------
$email_a = $email;
$titulo = Request::req("titulo");
$descripcion = Request::req("descripcion");
$perfil = Request::req("perfil");
$galeria = Request::req("galeria");
$style = "_plantilla1";
$usuario = new Usuario($email, sha1($clave), $alias, $fecha, $activo, $personal, $administrador);
$artista = new Artist($email, $titulo, $descripcion, $perfil, $galeria, $style);
$manageUsurio = new ManageUser($bd);
$manageArtist = new ManageArtist($bd);
$manageUsurio->insert($usuario);
$manageArtist->insert($artista);
header("Location: ../frontend/index.php");
}
示例2: read
function read()
{
//añadimos a cada propiedad de la clase ($this->$key) su valor si lo pasamos con el mismo nombre
foreach ($this as $key => $valor) {
$this->{$key} = Request::req($key);
}
}
示例3: loginSet
function loginSet()
{
echo 'LOGIN';
$email = Request::req("email");
$clave = sha1(Request::req("clave"));
header("Location: ../login/index.php?email={$email}&clave={$clave}");
}
示例4: handle
function handle()
{
$op = Request::req("op");
$metodo = $op;
//Aquí le decimos si existe el metodo en la clase (podemos llamar a otra clase en lugar de this)
if (method_exists($this, $metodo)) {
$this->{$metodo}();
} else {
$this->principal();
}
}
示例5: handle
static function handle()
{
$action = Request::req("action");
$target = Request::req("target");
$metodo = $action . ucfirst($target);
if (method_exists(get_class(), $metodo)) {
self::$metodo();
} else {
self::viewIndex();
}
}
示例6: handle
static function handle()
{
//gestionar la petición
$bd = new DataBase();
$gestor = new ManageObra($bd);
$gestorArtista = new ManageArtista($bd);
$action = Request::req("action");
$do = Request::req("do");
$metodo = $action . ucfirst($do);
if (method_exists(get_class(), $metodo)) {
self::$metodo($gestor, $gestorArtista);
} else {
self::readView($gestor, $gestorArtista);
}
}
示例7: handle
static function handle()
{
$bd = new DataBase();
$gestor = new ManageRelations($bd);
$action = Request::req("action");
$do = Request::req("do");
$metodo = $action . ucfirst($do);
if (method_exists(get_class(), $metodo)) {
//ucfirst pone la primera en mayuscula
echo 'El método existe';
self::$metodo($gestor);
} else {
echo 'la función no existe';
self::readView($gestor);
}
$bd->close();
}
示例8: editset
private static function editset()
{
$user = self::user();
if ($user) {
$db = new Database();
$manager = new ManagerUser($db);
$user->set(Request::reqFull());
$where['email'] = Request::req('old-email');
$res = $manager->set($user, $where);
$db->close();
}
self::editview();
}
示例9: registroYa
private static function registroYa($gestor, $sesion)
{
$email = Request::req("email");
if ($gestor->get($email)->getEmail() !== $email) {
$artista = new Artista($email);
$artista->read();
$artista->setClave(sha1($artista->getClave()));
if ($gestor->insert($artista)) {
MailGoogle::sendMailActivacion($email);
self::addArtista($gestor, $sesion, "Realizado con exito");
} else {
self::addArtista($gestor, $sesion, "Algun dato fallo al intentar modificarse" . var_dump($artista));
}
} else {
self::addArtista($gestor, $sesion, "Ese correo ya existe");
}
}
示例10: header
<?php
require '../clases/AutoCarga.php';
header('Contet-Type: application/json');
$sesion = new Session();
$no = json_encode(array('login' => false));
$pagina = Request::req("pagina");
if ($pagina === null) {
$pagina = 1;
}
if ($sesion->isLogged()) {
$bd = new DataBase();
$gestor = new ManageCity($bd);
$pager = new Pager($gestor->count());
$paginas = $pager->getPaginas();
$ciudades = $gestor->getListJson($pagina);
echo '{"ciudades":' . $ciudades . ', "paginas": ' . $paginas . '}';
$bd->close();
} else {
echo $no;
}
示例11: read2
public function read2()
{
foreach ($this as $key => $value) {
if (Request::req($key) === null) {
$this->{$key} = 0;
} else {
if (Request::req($key) === "on") {
$this->{$key} = 1;
} else {
$this->{$key} = Request::req($key);
}
}
}
}
示例12: editset
private static function editset()
{
$user = self::user();
if ($user && Request::get('password') == Request::get('rpassword')) {
$db = new Database();
$manager = new ManagerUser($db);
$user->set(Request::reqFull());
$res = $manager->set($user, Request::req('old-email'));
$db->close();
}
header('location:?op=edit&do=view');
}
示例13: writeStyle
private static function writeStyle($gestor, $sesion)
{
$user = $sesion->getUser();
$estilo = Request::req("estilo");
$fp = fopen('../artista/Themes/' . $user->getTema() . '/assets/css/mystyle.css', 'w');
fwrite($fp, $estilo);
fclose($fp);
self::changeStyle($gestor, $sesion);
}
示例14: Session
<?php
require '../../../../classes/AutoLoad.php';
$session = new Session();
$user = $session->getUser();
if ($user === NULL) {
header('Location:../login.php');
exit;
}
$request = Request::reqFull();
if (Request::req('administrator') == NULL) {
$request['administrator'] = 0;
}
if (!Request::req('personal') == NULL) {
$request['personal'] = 0;
}
$db = new Database();
$manager = new ManagerUser($db);
$user = $manager->get($request['pk']);
$user->set($request);
$res = $manager->set($user);
header("Location:../readuser.php?r={$res}&op=update");
示例15: header
<?php
require '../clases/AutoCarga.php';
header('Contet-Type: application/json');
$sesion = new Session();
$no = json_encode(array('delete' => -1));
if ($sesion->isLogged()) {
$bd = new DataBase();
$gestor = new ManageCity($bd);
$id = Request::req("ID");
$r = $gestor->delete($id);
$bd->close();
$respuesta = '{"delete":' . $r . '}';
echo $respuesta;
//var_dump($bd->getError());
} else {
echo $no;
}