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


PHP Events::getAllEvents方法代码示例

本文整理汇总了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("/");
     }
 }
开发者ID:Headrun-php,项目名称:TLG,代码行数:28,代码来源:EventsController.php

示例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());
}
开发者ID:CWFranklin,项目名称:lan-party-site,代码行数:18,代码来源:listEvents.php

示例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;
 }
开发者ID:sunshy360,项目名称:cubingchina,代码行数:11,代码来源:Competition.php

示例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);
开发者ID:scopeInfinity,项目名称:anwesha-1,代码行数:31,代码来源:allEvents.php


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