本文整理汇总了PHP中Events::getAllEvents方法的典型用法代码示例。如果您正苦于以下问题:PHP Events::getAllEvents方法的具体用法?PHP Events::getAllEvents怎么用?PHP Events::getAllEvents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Events
的用法示例。
在下文中一共展示了Events::getAllEvents方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
//
if (Auth::check()) {
$currentPage = "EVENTS";
$mainMenu = "EVENTS_MAIN";
$inputs = Input::all();
if (isset($inputs['eventName'])) {
$eventsAddResult = Events::addEvent($inputs);
if ($eventsAddResult) {
Session::flash('msg', "Event added successfully.");
return Redirect::to('events');
}
}
$provinces = Provinces::getProvinces("IN");
$eventTypes = EventTypes::getAllEventTypes();
$events = Events::getAllEvents();
$dataToView = array('currentPage', 'mainMenu', 'events', 'provinces', 'eventTypes');
return View::make('pages.events.events', compact($dataToView));
} else {
return Redirect::to("/");
}
}
示例2: header
<?php
require_once 'jsonCommon.php';
$events = Events::getAllEvents()->fetchAll();
if (isset($_REQUEST['format']) && $_REQUEST['format'] == 'csv') {
header('Content-Type: text/plain');
echo implode(',', array_keys($events[0]));
echo ',url';
echo "\n";
foreach ($events as $event) {
echo implode(',', $event);
echo ',http://www.westlan.co.uk/viewEvent.php?id=' . $event['id'];
echo "\n";
}
} else {
header('Content-Type: application/json');
echo json_encode(Events::getAllEvents()->fetchAll());
}
示例3: getRegistrationEvents
public function getRegistrationEvents()
{
$events = Events::getAllEvents();
$registrationEvents = array();
foreach ($this->events as $key => $value) {
if ($value['round'] > 0 && isset($events[$key])) {
$registrationEvents[$key] = $events[$key];
}
}
return $registrationEvents;
}
示例4: sha1
<?php
require 'model/model.php';
require 'dbConnection.php';
$filename = 'cache/' . sha1('anwesha/allEvents') . '.html';
$cache_time = 60;
if (file_exists($filename) && filemtime($filename) + $cache_time > time()) {
ob_start('ob_gzhandler');
header('Content-type: application/json');
readfile($filename);
// echo filemtime($filename) + $cache_time - time();
ob_end_flush();
exit;
}
$conn = mysqli_connect(SERVER_ADDRESS, USER_NAME, PASSWORD, DATABASE);
$allEvents = Events::getAllEvents($conn);
mysqli_close($conn);
header('Content-type: application/json');
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
// HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
// HTTP/1.0
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
// Date in the past
ob_start('ob_gzhandler');
echo json_encode($allEvents);
$file = fopen($filename, 'w');
fwrite($file, ob_get_contents());
fclose($file);