本文整理匯總了PHP中Thelia\Core\HttpFoundation\Request::get方法的典型用法代碼示例。如果您正苦於以下問題:PHP Request::get方法的具體用法?PHP Request::get怎麽用?PHP Request::get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Thelia\Core\HttpFoundation\Request
的用法示例。
在下文中一共展示了Request::get方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: theliaModule
/**
* Process theliaModule template inclusion function
*
* This function accepts two parameters:
*
* - location : this is the location in the admin template. Example: folder-edit'. The function will search for
* AdminIncludes/<location>.html file, and fetch it as a Smarty template.
* - countvar : this is the name of a template variable where the number of found modules includes will be assigned.
*
* @param array $params
* @param \Smarty_Internal_Template $template
* @internal param \Thelia\Core\Template\Smarty\Plugins\unknown $smarty
*
* @return string
*/
public function theliaModule($params, \Smarty_Internal_Template $template)
{
$content = null;
$count = 0;
if (false !== ($location = $this->getParam($params, 'location', false))) {
if ($this->debug === true && $this->request->get('SHOW_INCLUDE')) {
echo sprintf('<div style="background-color: #C82D26; color: #fff; border-color: #000000; border: solid;">%s</div>', $location);
}
$moduleLimit = $this->getParam($params, 'module', null);
$modules = ModuleQuery::getActivated();
/** @var \Thelia\Model\Module $module */
foreach ($modules as $module) {
if (null !== $moduleLimit && $moduleLimit != $module->getCode()) {
continue;
}
$file = $module->getAbsoluteAdminIncludesPath() . DS . $location . '.html';
if (file_exists($file)) {
$output = trim(file_get_contents($file));
if (!empty($output)) {
$content .= $output;
$count++;
}
}
}
}
if (false !== ($countvarname = $this->getParam($params, 'countvar', false))) {
$template->assign($countvarname, $count);
}
if (!empty($content)) {
return $template->fetch(sprintf("string:%s", $content));
}
return "";
}
示例2: notifyAction
/**
* @param Request $request
* @param $orderId
* @return Response
* @throws \Exception
*/
public function notifyAction(Request $request, $orderId)
{
$token = $request->get('token');
/** @var PaylineManager $payline */
$payline = $this->getContainer()->get('payline.manager');
if ($payline->getWebPaymentDetails($token)) {
$this->confirmPayment($orderId);
$this->cleanExpiredLog();
return new Response();
}
$this->cancelPayment($orderId);
$this->cleanExpiredLog();
return new Response();
}
示例3: getSimpleParams
protected function getSimpleParams(&$params, Request $request)
{
$params['category_id'] = $request->get('category_id');
$params['price_min'] = $request->get('price_min');
$params['price_max'] = $request->get('price_max');
$params['in_stock'] = $request->get('in_stock');
$params['new'] = $request->get('new');
$params['promo'] = $request->get('promo');
$params['limit'] = $request->get('limit') ? $request->get('limit') : 20;
$params['page'] = $request->get('page') ? $request->get('page') : 1;
$params['order'] = $request->get('order') ? $request->get('order') : 'alpha';
}