本文整理汇总了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();
}