Skip to content

Instantly share code, notes, and snippets.

@lonnen
Created November 10, 2011 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lonnen/1356011 to your computer and use it in GitHub Desktop.
Save lonnen/1356011 to your computer and use it in GitHub Desktop.
Barebones Report
<?php
class NewReport_Model extends Model {
public function getNewReportViaWebService() {
}
}
?>
<?php defined('SYSPATH') or die('No direct script access.');
require_once(Kohanna::find_file('libraries', 'somelib', TRUE 'php'));
class NewReport_Controller extends Controller {
public function __construct() {
parent::__construct();
$this->newreport_model = new NewReport_Model();
}
/**
* Public functions map to routes on the controller
* http://<base-url>/NewReport/index/[product, version, ?'foo'='bar', etc]
*/
public function index() {
$resp = $this->newreport_model->getNewReportViaWebService();
if ($resp) {
$this->setViewData(array(
'resp' => $resp,
'nav_selection' => 'new_report',
'foo' => $resp->foo,
));
} else {
header("Data access error", TRUE, 500);
$this->setViewData(array(
'resp' => $resp,
'nav_selection' => 'new_report',
));
}
}
}
?>
<?php slot::start('head') ?>
<title>New Report for <?php out::H($product) ?> <?php out::H($version) ?></title>
<?php echo html::script(array(
'js/path/to/scripts/you/need.js'
))?>
<?php echo html::stylesheet(array(
'css/path/to/css/you/need.css'
), 'screen')?>
<?php slot::end() ?>
<!-- Your custom front end HTML goes here -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment