本文整理匯總了PHP中Symfony\Component\HttpFoundation\Request::getGetOrPostBoolean方法的典型用法代碼示例。如果您正苦於以下問題:PHP Request::getGetOrPostBoolean方法的具體用法?PHP Request::getGetOrPostBoolean怎麽用?PHP Request::getGetOrPostBoolean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Symfony\Component\HttpFoundation\Request
的用法示例。
在下文中一共展示了Request::getGetOrPostBoolean方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: csv
function csv(Request $request, Application $app)
{
$ourRequest = new \Request($request);
$csv = new EventListCSVBuilder($app['currentSite'], $app['currentTimeZone']);
$csv->getEventRepositoryBuilder()->setVenueVirtualOnly(true);
$csv->setIncludeEventMedias($ourRequest->getGetOrPostBoolean("includeMedias", false));
$csv->build();
return $csv->getResponse();
}
示例2: jsonp
function jsonp(Request $request, Application $app)
{
$ourRequest = new \Request($request);
$jsonp = new EventListJSONPBuilder($app['currentSite'], $app['currentTimeZone']);
$jsonp->setIncludeEventMedias($ourRequest->getGetOrPostBoolean("includeMedias", false));
$jsonp->build();
if (isset($_GET['callback'])) {
$jsonp->setCallBackFunction($_GET['callback']);
}
return $jsonp->getResponse();
}
示例3: csv
function csv($slug, Request $request, Application $app)
{
$ourRequest = new \Request($request);
if (!$this->build($slug, $request, $app)) {
$app->abort(404, "curatedlist does not exist.");
}
$csv = new EventListCSVBuilder($app['currentSite'], $app['currentTimeZone']);
$csv->getEventRepositoryBuilder()->setCuratedList($this->parameters['curatedlist']);
$csv->setIncludeEventMedias($ourRequest->getGetOrPostBoolean("includeMedias", false));
$csv->build();
return $csv->getResponse();
}
示例4: listJson
public function listJson(Request $request, Application $app)
{
$grb = new GroupRepositoryBuilder();
$grb->setSite($app['currentSite']);
$ourRequest = new \Request($request);
$grb->setIncludeDeleted($ourRequest->getGetOrPostBoolean('include_deleted', false));
$out = array('groups' => array());
foreach ($grb->fetchAll() as $group) {
$out['groups'][] = array('slug' => $group->getSlug(), 'slugForURL' => $group->getSlugForUrl(), 'title' => $group->getTitle());
}
return json_encode($out);
}
示例5: listJson
public function listJson(Request $request, Application $app)
{
$erb = new EventRepositoryBuilder();
$erb->setSite($app['currentSite']);
$ourRequest = new \Request($request);
$erb->setIncludeDeleted($ourRequest->getGetOrPostBoolean('include_deleted', false));
$out = array('events' => array());
foreach ($erb->fetchAll() as $event) {
$out['events'][] = array('slug' => $event->getSlug(), 'slugForURL' => $event->getSlugForUrl(), 'summary' => $event->getSummary(), 'summaryDisplay' => $event->getSummaryDisplay());
}
return json_encode($out);
}
示例6: jsonp
function jsonp($slug, Request $request, Application $app)
{
$ourRequest = new \Request($request);
if (!$this->build($slug, $request, $app)) {
$app->abort(404, "Group does not exist.");
}
$jsonp = new EventListJSONPBuilder($app['currentSite'], $app['currentTimeZone']);
$jsonp->getEventRepositoryBuilder()->setGroup($this->parameters['group']);
$jsonp->setIncludeEventMedias($ourRequest->getGetOrPostBoolean("includeMedias", false));
$jsonp->build();
if (isset($_GET['callback'])) {
$jsonp->setCallBackFunction($_GET['callback']);
}
return $jsonp->getResponse();
}
示例7: jsonp
function jsonp($slug, Request $request, Application $app)
{
if (!$this->build($slug, $request, $app)) {
$app->abort(404, "Event does not exist.");
}
$eventMedias = array();
$ourRequest = new \Request($request);
if ($ourRequest->getGetOrPostBoolean("includeMedias", false)) {
$mrb = new MediaRepositoryBuilder();
$mrb->setEvent($this->parameters['event']);
$mrb->setIncludeDeleted(false);
$eventMedias = $mrb->fetchAll();
}
$jsonp = new EventListJSONPBuilder($app['currentSite'], $app['currentTimeZone']);
$jsonp->addEvent($this->parameters['event'], $this->parameters['groups'], $this->parameters['venue'], $this->parameters['area'], $this->parameters['country'], $eventMedias);
if (isset($_GET['callback'])) {
$jsonp->setCallBackFunction($_GET['callback']);
}
return $jsonp->getResponse();
}