ja.son-williams.ca/www/plugins/jasonwilliams/calgaryconditions/components/CurrentInfo.php

24 lines
538 B
PHP

<?php namespace JasonWilliams\CalgaryConditions\Components;
use Cms\Classes\ComponentBase;
use ApplicationException;
class CurrentInfo extends ComponentBase
{
public $fields;
public function componentDetails()
{
return [
'name' => 'Current Info',
'description' => 'Displays the current weather and time in Calgary, AB, Canada'
];
}
public function onRun()
{
date_default_timezone_set('America/Edmonton');
$this->fields['time'] = date('g:ia');
}
}