本文整理汇总了PHP中request::get方法的典型用法代码示例。如果您正苦于以下问题:PHP request::get方法的具体用法?PHP request::get怎么用?PHP request::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类request
的用法示例。
在下文中一共展示了request::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addApproAutre
public function addApproAutre(request $request, $idFournisseur)
{
if ($request->get('option') !== null) {
$doctrine = $this->doctrine;
$fournisseur = $doctrine->getRepository('ICApprovisionnementBundle:Fournisseur')->findOneBy(array('id' => $idFournisseur));
$appro = new Appro();
$appro->setFournisseur($fournisseur);
$appro->setTypeProduit($fournisseur->getType());
$appro->setDateCommande(new \Datetime());
$doctrine->persist($appro);
$doctrine->flush();
$lastAppro = $doctrine->getRepository('ICApprovisionnementBundle:Appro')->getLastAppro();
if ($fournisseur->getType() == 4) {
foreach ($request->get('option') as $idAutre) {
$autre = $doctrine->getRepository('ICApprovisionnementBundle:Autre')->findOneBy(array('id' => $idAutre));
$approAutre = new ApproAutre();
$approAutre->setAutre($autre);
$approAutre->setQuantite($request->get($idAutre));
$approAutre->setAppro($lastAppro[0]);
$doctrine->persist($approAutre);
}
} elseif ($fournisseur->getType() == 3) {
foreach ($request->get('option') as $idLecteur) {
$typeLecteur = $doctrine->getRepository('ICApprovisionnementBundle:TypeLecteurAutre')->findOneBy(array('id' => $idLecteur));
$approLecteur = new ApproLecteur();
$approLecteur->setTypeLecteurAutre($typeLecteur);
$approLecteur->setQuantite($request->get($idLecteur));
$approLecteur->setAppro($lastAppro[0]);
$doctrine->persist($approLecteur);
}
}
$doctrine->flush();
}
}
示例2: subscribeAction
/**
* @Route("/api/subscribe", name="site_subscribe")
*/
public function subscribeAction(request $request)
{
$em = $this->getDoctrine()->getManager();
$name = $request->get('name');
$mail = $request->get('mail');
$subscriber = new Subscriber();
$subscriber->setName($name)->setMail($mail);
$em->persist($subscriber);
$em->flush();
$request->getSession()->getFlashBag()->add('success', 'Dank u voor het inschrijven voor de nieuwsletter.');
return new response();
}
示例3: execTinyMce
protected function execTinyMce($prm=null) {
$search = 'js/tiny_mce/';
$request = request::get('request');
$pos = strpos($request, $search);
if ($pos === false)
exit;
$tmp = substr($request, $pos+strlen($search));
$file = file::nyroExists(array(
'name'=>'lib'.DS.'tinyMce'.DS.$tmp,
'realName'=>true,
'type'=>'other'
));
if (strpos($file, '.php') !== false) {
array_walk($_GET, create_function('&$v', '$v = urldecode($v);'));
$path = str_replace($tmp, '', $file);
ini_set('include_path', $path);
define('TINYMCEPATH', substr($path, 0, -1));
define('TINYMCECACHEPATH', substr(TMPROOT, 0, -1));
if (ob_get_length())
ob_clean();
include($file);
exit;
} else
response::getInstance()->showFile($file);
}
示例4: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(request $request)
{
//
$folder = $request->get('folder');
$data = $this->manager->folderInfo($folder);
return view('admin.upload.index', $data);
}
示例5: updateDepartmentAction
public function updateDepartmentAction(request $request)
{
// Get the ID variable from the request
$id = $request->get('id');
// Create a new Department entity
$department = new Department();
$em = $this->getDoctrine()->getManager();
// Find a department by the ID sent in by the request
$department = $em->getRepository('AppBundle:Department')->find($id);
// Only edit if it is a SUPER_ADMIN
if ($this->get('security.context')->isGranted('ROLE_SUPER_ADMIN')) {
// Create the form
$form = $this->createForm(new CreateDepartmentType(), $department);
// Handle the form
$form->handleRequest($request);
if ($form->isValid()) {
$em->persist($department);
$em->flush();
return $this->redirect($this->generateUrl('departmentadmin_show'));
}
return $this->render('department_admin/create_department.html.twig', array('department' => $department, 'form' => $form->createView()));
} else {
return $this->redirect($this->generateUrl('departmentadmin_show'));
}
}
示例6: toHtml
public function toHtml()
{
if ($this->cfg->useJs) {
$this->cfg->setInArray('html', 'class', $this->cfg->getInArray('html', 'class') . ' date');
$resp = response::getInstance();
$resp->addJs('jqueryui');
if (($lang = request::get('lang')) != 'en') {
$resp->addJs('i18n_ui.datepicker-' . $lang);
}
$jsPrmMin = $this->cfg->jsPrm;
$jsPrmMax = $this->cfg->jsPrm;
$minId = $this->makeId($this->name . '[0]');
$maxId = $this->makeId($this->name . '[1]');
$minDate = $this->dates['min']->getJs(null);
$maxDate = $this->dates['max']->getJs(null);
$jsPrmMin['onSelect'] = 'function(dateText) {$("#' . $maxId . '").datepicker("option", "minDate", $("#' . $minId . '").datepicker("getDate"));}';
if ($maxDate) {
$jsPrmMin['maxDate'] = $maxDate;
}
$jsPrmMax['onSelect'] = 'function(dateText) {$("#' . $minId . '").datepicker("option", "maxDate", $("#' . $maxId . '").datepicker("getDate"));}';
if ($minDate) {
$jsPrmMax['minDate'] = $minDate;
}
$resp->blockJquery('
$("#' . $minId . '").datepicker(' . utils::jsEncode($jsPrmMin) . ');
$("#' . $maxId . '").datepicker(' . utils::jsEncode($jsPrmMax) . ');
');
}
return parent::toHtml();
}
示例7: indexAction
public function indexAction(request $request)
{
$session = $this->getRequest()->getSession();
if ($request->getMethod() == 'POST') {
$session->clear();
$username = $request->get('usuario');
$password = $request->get('password');
//$em = $this->getDoctrine()->getManager();
$query = $this->getDoctrine()->getRepository('usuariosBundle:PerfilUsuario')->createQueryBuilder('perfil')->select('perfil', 'usuario', 'tipo_usuario')->innerJoin('usuariosBundle:Usuarios', 'usuario', 'WITH', 'perfil.usuario = usuario.id')->innerJoin('usuariosBundle:TipoUsuario', 'tipo_usuario', 'WITH', 'usuario.tipoUsuario = tipo_usuario.id')->where('perfil.nombreUsuario = :user')->setParameter('user', $username)->getQuery();
$user = $query->getArrayResult();
$passwords = $this->getDoctrine()->getRepository('usuariosBundle:Passwords')->findOneBy(array('perfil' => $user[0]['id'], 'activo' => true));
if ($user) {
$factory = $this->get('security.encoder_factory');
$codificador = $factory->getEncoder($passwords);
$validador = $codificador->isPasswordValid($passwords->getPassword(), $password, $passwords->getSalt());
if ($validador) {
$session = $request->getSession();
$session->set("email", $user[0]['email']);
$session->set("perfil_activo", $user[0]['activo']);
$session->set("pass_activo", $passwords->getActivo());
if ($session->get('perfil_activo') == 1) {
if ($session->get('pass_activo') == 1) {
$session->set("usuario_id", $user[0]['id']);
$session->set("autenticado", true);
$session->set("nombre_usuario", $user[0]['nombreUsuario']);
$session->set("nombres", $user[1]['nombres']);
$session->set("tipo_usuario", $user[2]['nombre']);
$session->set("id_tipo_usuario", $user[2]['id']);
return $this->render('inicialBundle:Default:index.html.twig');
} else {
$this->get('session')->getFlashBag()->add('warning', 'Clave Inactiva debe actualizar su clave');
}
} else {
$this->get('session')->getFlashBag()->add('danger', 'Usuario Inactivo Contactar con el administrador del sistema');
return $this->render('inicialBundle:Default:index.html.twig');
}
} else {
$this->get('session')->getFlashBag()->add('danger', 'Datos incorrectos');
return $this->render('inicialBundle:Default:index.html.twig');
}
} else {
$this->get('session')->getFlashBag()->add('danger', 'Datos incorrectos');
return $this->render('inicialBundle:Default:index.html.twig');
}
}
return $this->render('inicialBundle:Default:index.html.twig');
}
示例8: invoke
function invoke(S2SRequest $request)
{
$cmd = request::get('cmd');
$func = '_' . str_replace('.', '_', $cmd);
if (is_callable(array($this, $func))) {
return call_user_func(array($this, $func), array($request));
}
}
示例9: activate
public static function activate()
{
if (request::get(1) == 'activation') {
$user = user::activate(request::get(2));
return $user;
} else {
return new user();
}
}
示例10: getInstance
/**
* Get the response object according to the requested out
*
* @return response_abstract
*/
public static function getInstance() {
if (self::$proxy)
return self::$proxy;
if (!self::$inst) {
self::$inst = factory::get('response_'.request::getResponseName());
self::$inst->setContentType(request::get('out'));
}
return self::$inst;
}
示例11: updatesousFamilleAction
public function updatesousFamilleAction(request $request, $idSousFamille)
{
$em = $this->getDoctrine()->getManager();
$sousFamille = $em->getRepository('ICAdministrationBundle:SousFamille')->find($idSousFamille);
$sousFamille->setNom($request->get('nom'));
$em->persist($sousFamille);
$em->flush();
return $this->redirectToRoute('ic_administration_affichage_sous_famille');
}
示例12: showPost
public function showPost($slug, request $request)
{
$post = Post::whereSlug($slug)->firstOrFail();
$tag = $request->get('tag');
if ($tag) {
$tag = Tag::whereTag($tag)->firstOrFail();
}
return view($post->layout, compact('post', 'tag', 'slug'));
}
示例13: output
public function output()
{
$this->parseUrl();
if (isset($_COOKIE['relo_backend']) && beuser::verifyCookie($_COOKIE['relo_backend']) !== false || isset($_SESSION['beuser_id']) && $_SESSION['beuser']->isAdmin() === true) {
// logged in
$user = new beuser($_SESSION['beuser_id']);
beuser::setCookie($user->get('id'), $user->get('password'));
$_SESSION['beuser'] = $user;
$_SESSION['beuserId'] = $user->get('id');
$this->user = $user;
if ($this->requestedView == 'login') {
header('Location: ' . config::get('system')['startpage']);
}
} else {
// Not Logged In
if ($this->requestedView == 'ajax' && (isset($_POST['module']) && $_POST['module'] == 'login')) {
} else {
if ($this->requestedView != 'login') {
header('Location: login');
exit;
}
}
}
switch ($this->requestedView) {
case 'imagemanager':
$image = new Image(request::get(1), request::get(2));
break;
case 'upload':
include 'classes/util/upload.class.php';
$upload_handler = new UploadHandler();
break;
case 'ajax':
if ($_POST['module'] == 'system') {
include 'classes/basic/system.ajaxhandler.php';
} elseif ($_POST['module'] == 'autofill') {
include 'classes/util/autofill.php';
} elseif ($_POST['module'] == 'user') {
include '../data/classes/basic/user.ajaxhandler.php';
} else {
include 'classes/custom/' . $_POST['module'] . '/' . $_POST['module'] . '.ajaxhandler.php';
}
break;
case 'code':
$this->requestedView = 'default';
default:
$this->renderContent($this->requestedView);
/* if module is requested, execute it */
if ($this->requestedModule != '') {
$this->processModule();
}
$this->OutputContainer = implode($this->container);
//load view-specific template
include './data/template/standard.tmpl.php';
break;
}
}
示例14: searchAction
public function searchAction(request $request)
{
$term = $request->get('query');
$repository = $this->getDoctrine()->getManager()->getRepository('BFUserBundle:User');
$array = $repository->findUserLike($term);
//making the array for the plugin
$response = new Response(json_encode($array));
$response->headers->set('Content-Type', 'application/json');
return $response;
}
示例15: execCssExt
protected function execCssExt($prm=null) {
$file = $prm[0];
if (request::get('text'))
$file.= DS.request::get('text');
response::getInstance()->showFile(file::nyroExists(array(
'name'=>'module'.DS.nyro::getCfg()->compressModule.DS.'css'.DS.$file,
'realName'=>true,
'type'=>'other'
)));
}