Skip to content

Instantly share code, notes, and snippets.

View dragoonis's full-sized avatar

Paul Dragoonis dragoonis

View GitHub Profile
/**
* @param string $var
* @param mixed $default
* @return mixed
*/
function get($var, $default = null) {
if(empty($this->_uriParams)) {
$this->processUriParams();
}
if(isset($_GET[$var])) {
+---------------+--------------------------------------------------------------+
| title | category |
+---------------+--------------------------------------------------------------+
| Framework | sendMail() |
| Framework | Email sending |
| Framework | Implementation of Disk based cache aka PPI_Cache_Disk |
| Framework | Add PPI_Controller->set() |
| Framework | Check view file existance. |
| Framework | Wrap view output in output buffering |
| Framework | Exception Page Changes |
<?php
$modules = isset($_GET['mod']) ? explode(',', str_replace('../', '', $_GET['mod'])) : array();
$css = '';
foreach($modules as $module) {
if(file_exists("{$module}.css")) {
$css .= "/* ---- {$module}.css ---- */ \n\n" . file_get_contents($module . '.css') . "\n\n";
}
}
if($css !== '') {
header('Content-type: text/css');
<?php
$modules = isset($_GET['mod']) ? explode(',', str_replace('../', '', $_GET['mod'])) : array();
$js = '';
foreach($modules as $module) {
if(file_exists("{$module}.js")) {
$js .= "/* ---- {$module}.js ---- */ \n\n" . file_get_contents($module . '.js') . "\n\n";
}
}
if($js !== '') {
header('Content-type: text/javascript');
<?php
class APP_Controller_Panel extends APP_Controller_Application {
protected $_authMethods = array('foo', 'bar', 'required');
}
class APP_Controller_Application extends PPI_Controller {
function __construct() {
<?php
protected function render() {
$masterTemplate = $this->_view->getMasterTemplate();
$viewDir = $this->_view->getViewDir();
$core = array();
$core['charset'] = $this->_response->getCharset();
$core['url'] = $this->_request->getUrl();
<?php
protected function render($template, array $options = array()) {
$core = array();
$core['charset'] = $this->_response->getCharset();
$core['url'] = $this->_request->getUrl();
$core['uri'] = $this->_request->getUri();
$core['is'] = array(
<?php
protected function render($template, array $options = array()) {
$core = array();
$core['charset'] = $this->_response->getCharset();
$core['url'] = $this->_request->getUrl();
$core['uri'] = $this->_request->getUri();
$core['flash'] = $this->_response->getFlashAndClear();
$core['is'] = array(
<?php
/**
* The main render function that pull in data from all framework components to render this page.
*
* @param string $template
* @param array $options
* @return void
*/
protected function render($template, array $options = array()) {
<?php
public function getRenderVars() {
return array(
'flash' => $this->getFlashAndClear(),
'charset' => $this->_charset,
'files' => array(
'css' => $this->_cssFiles,
'js' => $this->_jsFiles
)
);