Skip to content

Instantly share code, notes, and snippets.

if ( ! function_exists('render_view'))
{
function render_view($view, $data= array())
{
$ar_view= explode('/', $view);
$dir= array_shift($ar_view);
$previous_dir= $GLOBALS['d'];
$view= implode('/', $ar_view);
$GLOBALS['d']= $dir;
$body= view($view, $data);
@cj
cj / view.php
Created December 30, 2010 22:15
<?
/**
* Load global view temp
*
* @author CJ Lazell
* @param string $filename
* @param array $data
* @param boolean $string
* @return void
*/
if( ! function_exists('link_tag') )
{
function link_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE)
{
$ob = this();
$link = '<link ';
$vi = Ssc::instance(); // obullo changes ..
/**
* Link
*
* Generates link to a CSS file
*
* @access public
* @param mixed stylesheet hrefs or an array
* @param string rel
* @param string type
* @param string title
<?= doctype('html5')."\n"; ?>
<html>
<head>
<?= meta('Content-type', 'text/html; charset=utf-8', 'equiv'); ?>
<?= view_var('meta'); ?>
<title><?= view_var('title'); ?></title>
<?= view_var('head'); ?>
<?= css('../auth/login'); ?>
*/
if( ! isset($_head->_tag)) // Helper Constructror
{
$_head = Ssc::instance();
$_head->_tag = new stdClass();
$_head->_tag->arr_store = array();
log_me('debug', "Head_tag Helper Initialized");
}
<?= doctype('html5')."\n"; ?>
<html>
<head>
<?= meta('Content-type', 'text/html; charset=utf-8', 'equiv'); ?>
<?= view_var('meta'); ?>
<title><?= view_var('title'); ?></title>
<?= view_var('head'); ?>
@cj
cj / vimrc
Created January 2, 2011 18:20
noremap <c-h> <c-w>h
noremap <c-j> <c-w>j
noremap <c-k> <c-w>k
noremap <c-l> <c-w>l
<?
/**
* view_data
*
* Enables you to set data that is persistent in all views
*
* @author CJ Lazell
* @param array $data
* @access public
* @return void
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
//> makes dw cs4 happy
/**
* Session class using native PHP session features and hardened against session fixation.
*
* @package CodeIgniter
* @subpackage Libraries
* @category Sessions
* @author Dariusz Debowczyk, Matthew Toledo