当前位置: 首页>>代码示例>>PHP>>正文


PHP request::get方法代码示例

本文整理汇总了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();
     }
 }
开发者ID:toko30,项目名称:GestStock,代码行数:34,代码来源:ICApprovisionnementPF.php

示例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();
 }
开发者ID:jojotjebaby,项目名称:hedonis,代码行数:15,代码来源:SubscriberController.php

示例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);
	}
开发者ID:nyroDev,项目名称:nyroFwk,代码行数:25,代码来源:controller.class.php

示例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);
 }
开发者ID:edom-huang,项目名称:myBlog,代码行数:12,代码来源:UploadController.php

示例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'));
     }
 }
开发者ID:vegardbb,项目名称:webpage,代码行数:25,代码来源:DepartmentController.php

示例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();
    }
开发者ID:nyroDev,项目名称:nyroFwk,代码行数:30,代码来源:date.class.php

示例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');
 }
开发者ID:kcoronil,项目名称:feyalegria,代码行数:47,代码来源:DefaultController.php

示例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));
     }
 }
开发者ID:noccy80,项目名称:lepton-ng,代码行数:8,代码来源:endpoint.php

示例9: activate

 public static function activate()
 {
     if (request::get(1) == 'activation') {
         $user = user::activate(request::get(2));
         return $user;
     } else {
         return new user();
     }
 }
开发者ID:hurradieweltgehtunter,项目名称:Framework---relo,代码行数:9,代码来源:login.controller.php

示例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;
	}
开发者ID:nyroDev,项目名称:nyroFwk,代码行数:14,代码来源:response.class.php

示例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');
 }
开发者ID:toko30,项目名称:GestStock,代码行数:9,代码来源:OptionController.php

示例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'));
 }
开发者ID:edom-huang,项目名称:myBlog,代码行数:9,代码来源:BlogController.php

示例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;
     }
 }
开发者ID:hurradieweltgehtunter,项目名称:Framework---relo,代码行数:56,代码来源:system.class.php

示例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;
 }
开发者ID:jojotjebaby,项目名称:Bestfootball,代码行数:10,代码来源:LoggedController.php

示例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'
		)));
	}
开发者ID:nyroDev,项目名称:nyroFwk,代码行数:10,代码来源:controller.class.php


注:本文中的request::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。