OSB enhancements to date
This commit is contained in:
50
application/classes/company.php
Normal file
50
application/classes/company.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
/**
|
||||
* This class is for access company informaiton.
|
||||
*
|
||||
* @package OSB
|
||||
* @subpackage Page
|
||||
* @category Helpers
|
||||
* @author Deon George
|
||||
* @copyright (c) 2010 Deon George
|
||||
* @license http://dev.leenooks.net/license.html
|
||||
*/
|
||||
class Company {
|
||||
public static function instance() {
|
||||
return new Company;
|
||||
}
|
||||
|
||||
public static function address($ln='<br/>') {
|
||||
// @todo Company address should be calculated
|
||||
return implode($ln,array('PO Box 149','Bendigo, VIC 3550'));
|
||||
}
|
||||
|
||||
public static function contacts() {
|
||||
// @todo Company phone should be calculated
|
||||
return 'Tel: 03 5410 1135';
|
||||
}
|
||||
|
||||
public static function render() {
|
||||
echo static::name();
|
||||
echo static::address();
|
||||
echo static::contacts();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the HTML to render the company address
|
||||
*/
|
||||
public function __toString() {
|
||||
try {
|
||||
return static::render();
|
||||
}
|
||||
|
||||
// Display the exception message
|
||||
catch (Exception $e) {
|
||||
Kohana::exception_handler($e);
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user