#4 | Phalcon\Mvc\View\Engine\AbstractEngine->partial
/home/xpatlink/apps/xpatweb/cache/user/user_home_xpatlink_apps_xpatweb_xpatlink_modules_user_views_events_sports.volt.php (10) <header class="catergory-header">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="d-flex justify-content-between">
<div class="cat-header float-left">
<h1>Sports</h1>
</div>
<div class="filtermenu">
<?php $this->partial("../../../views/eventsmenu"); ?>
</div>
</div>
</div>
</div>
</div>
</header>
<?php
$today = new DateTime();
$today->setTimezone(new DateTimeZone('Africa/Nairobi'));
$today = $today->format('Y-m-d');
?>
<section class="contentarea">
<div class="container">
<div class="row">
<div class="col-md-8">
<div class="event-tp-slide">
<div class="eventsCarousel">
<!-- Item -->
<?php foreach ($events as $event) {
if ($event->slider == 1 && $event->enddate > $today) { ?>
<div class="event-sm-Block">
<div class="Content"> <a href="/events/view/<?php echo $event->id; ?>"><img src="/images/events/<?php echo $event->image; ?>" alt="<?php echo $event->name; ?>"> </a></div>
</div>
<?php } } ?>
</div>
<!-- Carousel Container -->
<div class="eventsmain">
<div class="col-md-12">
<div class="eventstitle">
<h2>Sports</h2>
</div>
<article class="row">
<?php
$_sports = $this->events->getSports();
foreach ($_sports as $event) {
if($event->enddate > $today){
?>
<div class="col-sm-6 col-lg-4">
<div class="eventcontainer">
<div class="imagearea_event view view-first"> <img src="/images/events/<?php echo $event->image; ?>" alt="Xpatlink" />
<div class="mask"> <a href="eventsinside.html" class="info">Read More</a> </div>
</div>
<div class="eventsmaininfo">
<h3><?php echo $event->name; ?></h3>
</div>
<div class="eventsdate">
<?php
$start_date = $event->startdate;
$daynow = date('l', strtotime($event->startdate));
$daynum = date('j', strtotime($start_date));
?>
<p><?php echo substr(date('F', strtotime($event->startdate)), 0,3); ?>
<span><?php echo $daynum; ?></span>
<p> <?php echo ' '.date('Y', strtotime($start_date)); ?></p>
<p>-</p>
<?php
$end_date = $event->enddate;
$daynow = date('l', strtotime($event->enddate));
$daynum = date('j', strtotime($end_date));
?>
<p><?php echo substr(date('F', strtotime($event->enddate)), 0,3); ?>
<span><?php echo $daynum; ?></span>
<p> <?php echo ' '.date('Y', strtotime($end_date)); ?></p>
</div>
</div>
</div>
<?php } } ?>
</article>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="aside-evnts">
<h1>Post your event today</h1>
<p>List your event for free. Boost ticket sales, reach new audiences, and get your event seen. Start your listing now.</p>
</div>
<div class="aside-event-btn"><a href="/events/create">Post Event</a></div>
<div class="aside-event-slide">
<h2>Upcoming Events</h2>
<!--Week Event-->
<div class="eventsweek">
<div class="eventweek_header">
<h2>This Week</h2>
</div>
<div class="events-aside-Carousel">
<?php $this->partial("../../../views/thisweek"); ?>
</div>
</div>
<div class="aside-evnts">
<h1>Stay up to date on Events</h1>
<p>With a jam-packed schedule, it's understandably difficult to find time to stay up to date on current events. Staying up to date doesn't have to be frustrating get alerts sent to you.</p>
</div>
<!-- <div class="aside-event-btn"><a href="eventsinside-form.html">Set up event alerts</a></div> -->
</div>
</div>
</div>
</div>
</section>
|
#10 | Phalcon\Mvc\Application->handle
/home/xpatlink/apps/xpatweb/public/index.php (262) <?php
// ini_set('display_errors', '1');
// ini_set('display_startup_errors', '1');
// error_reporting(E_ALL);
use Phalcon\Mvc\Router,
Phalcon\Mvc\Application,
Phalcon\DI\FactoryDefault,
Phalcon\Security,
Phalcon\Loader;
use Phalcon\Logger;
use Phalcon\Logger\Adapter\File as FileAdapter;
use Phalcon\Http\Cookie;
use Phalcon\Http\Response\Cookies;
use Phalcon\Logger\Adapter\Stream;
(new \Phalcon\Debug)->listen();
//echo phpinfo(); exit;
define('BASE_PATH', dirname(__DIR__));
define("BASE_URL", 'https://'. $_SERVER['HTTP_HOST']);
define('APP_PATH', BASE_PATH . '/Xpatlink');
define('HOMEIMAGE_PATH', BASE_PATH . '/public/images/homepage/');
define('CATEGORY_BANNER', BASE_PATH . '/public/images/categorybanners/');
define('MAGAZINE_PICTURE', BASE_PATH . '/public/images/issues/');
define('ADVERTS_PATH', BASE_PATH . '/public/images/xpatlink/');
define('ADTESTS_PATH', BASE_PATH . '/public/images/xpatlinktest/');
define('EVENTS_PATH', BASE_PATH . '/public/images/events/');
define('XPRESSION_PATH', BASE_PATH . '/public/images/xpression/');
define('XFOOD_PATH', BASE_PATH . '/public/images/xfood/');
define('XDEALS_PATH', BASE_PATH . '/public/images/xdeals/');
define('CATEGORYOG_PATH', BASE_PATH . '/public/images/categoryog/');
define('ROOT_PATH', dirname(__DIR__));
$config = include APP_PATH . "/Config/config.php";
//try {
/**
* The FactoryDefault Dependency Injector automatically registers
* the services that provide a full stack framework.
*/
$di = new FactoryDefault();
//Specify routes for modules
$di->set('router', function () {
$router = new Router();
$router->setDefaultModule("user");
$router->add(
"/:controller/:action",
array(
"module" => 'user',
"controller" => 1,
"action" => 2
));
// $router->add(
// "/:controller/:action/:params",
// array(
// "module" => 'user',
// "controller" => 1,
// "action" => 2,
// "params" => 3
// ));
$router->add('/:controller/:action/:params',
array(
"module" => 'user',
"controller"=>1,
"action"=>2,
"params"=>3
)
)->convert('action', function($action){
return lcfirst(Phalcon\Text::camelize($action));
});
return $router;
});
require_once(APP_PATH . '/Library/DiFile.php');
$di->setShared('connection', function () use ($config) {
return new \Phalcon\Db\Adapter\Pdo\Mysql([
"host" => $config->database->host,
"username" => $config->database->username,
"password" => $config->database->password,
"dbname" => $config->database->dbname,
]);
});
$di->setShared('session', function() {
// $session = new \Phalcon\Session\Adapter\Stream();
// $session->start();
// return $session;
$session = new Phalcon\Session\Manager();
$files = new Phalcon\Session\Adapter\Stream( [
'savePath' => '/tmp',
]);
$session->setAdapter($files)->start();
return $session;
});
// $di->setShared('random', function() {
// $random = new Phalcon\Security\Random();
// return $random;
// });
$di->set('flash', function () {
$flash = new \Phalcon\Flash\Direct (
array(
'error' => 'alert alert-danger',
'success' => 'alert alert-success',
'notice' => 'alert alert-info',
'warning' => 'alert alert-warning'
)
);
return $flash;
});
$di->setShared('flashSession', function () {
$flash = new \Phalcon\Flash\Session (
// array(
// 'error' => 'alert alert-danger',
// 'success' => 'alert alert-success',
// 'notice' => 'alert alert-info',
// 'warning' => 'alert alert-warning'
// )
);
return $flash;
});
$di->set(
"logger",
function () {
$logger = new FileAdapter("__DIR__ . '/../../Xpatlink/logger.log");
return $logger;
}
);
$di->setShared('controllerPath', function () {
if (!empty($_SERVER['REQUEST_URI'])) {
$uriParts = explode('?', $_SERVER['REQUEST_URI']);
$segment = explode('/', $uriParts[0]);
// $uri = str_replace('/', '', $uriParts[0]);
$uri = $segment[1].'/';
} else {
$uri = '/';
}
return $uri;
});
$di->set('users',function () {
include APP_PATH . '/Services/Users.php';
return new Users();
},
true
);
$di->set('categories',function () {
include APP_PATH . '/Services/Categories.php';
return new Categories();
},
true
);
$di->set('advertise',function () {
include APP_PATH . '/Services/Advertise.php';
return new Advertise();
},
true
);
$di->set('directpay',function () {
include APP_PATH . '/Services/Directpay.php';
return new Directpay();
},
true
);
$di->set('item',function () {
include APP_PATH . '/Services/Item.php';
return new Item();
},
true
);
$di->set('redis',function () {
include BASE_PATH . '/vendor/autoload.php';
include BASE_PATH . '/vendor/predis/Autoloader.php';
Predis\Autoloader::register();
/* $client = new Predis\Client();
$client->set('foo', 'bar');
$value = $client->get('foo');*/
$redis = new Predis\Client(array(
"scheme" => "tcp",
"host" => "127.0.0.1",
"port" => 6379
));
return $redis;
});
$application = new \Phalcon\Mvc\Application($di);
//Create an application
// Register the installed modules
$application->registerModules(
array(
'user' => array(
'className' => 'Xpatlink\Modules\User\Module',
'path' => APP_PATH.'/Modules/User/Module.php',
),
'admin' => array(
'className' => 'Xpatlink\Modules\Admin\Module',
'path' => APP_PATH.'/Modules/Admin/Module.php',
),
)
);
$request = new \Phalcon\Http\Request();
echo $application->handle($request->getURI())->getContent();
/*} catch (\Exception $e) {
echo $e->getMessage() . '<br>';
echo '<pre>' . $e->getTraceAsString() . '</pre>';
}*/
|