PHP code example of campusunion / sked
1. Go to this page and download the library: Download campusunion/sked library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
campusunion / sked example snippets
$sked = new \CampusUnion\Sked([
'data_connection' => [
'name' => 'PDO',
'options' => [
'driver' => 'mysql',
'host' => 'localhost',
'dbname' => 'homestead',
'user' => 'homestead',
'pass' => 'secret',
],
],
]);
echo $sked->form();
$sked->save(new SkeVent($_POST));
foreach ($sked->skeDates('2016-08-05', '2016-09-21')) {
// do something awesome
}
echo $skeDate->format('j'); // default format is 'Y-m-d' (e.g., 2016-08-05)
foreach ($skeDate->skeVents(/* Optionally pass a user ID to get events for a certain user. */)) {
// do something awesome
}
echo $skeVent->label;
echo $skeVent->time('Hi'); // default format is 'g:ia' (e.g., 2:15pm)
echo $skeVent->time(null, -5); // outputs the time adjusted for US Eastern Standard time
Sked::skeDoosh([
'data_connector' => [
'name' => 'PDO',
'options' => [
'driver' => 'mysql',
'host' => 'localhost',
'dbname' => 'homestead',
'user' => 'homestead',
'pass' => 'secret',
],
],
]);