Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><?php echo $this->layout->placeholder('title'); ?></title>
<?php echo $this->layout->placeholder('meta'); ?>
<?php echo $this->layout->css(); ?>
<?php echo $this->layout->js(); ?>
</head>
<body>
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class page extends CI_Model {
var $code = "";
var $permalink = "";
function __construct()
{
parent::__construct();
}
<textarea id="content"></textarea>
<div class="clear"></div>
<input type="submit" />
</form>
$(function() {
$('textarea#content').tinymce({
// Location of TinyMCE script
script_url : '/js/tiny_mce/tiny_mce.js',
// General options
theme : "advanced",
plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
// Theme options
@jlebrech
jlebrech / gist:809350
Created February 3, 2011 11:02
in the controller
<?php
function add()
{
$this->setupLayout('Add page',array(),true); // this set's the title, navigation bar, and whether this is an admin view of frontend view
$this->save();
}
function edit($id=null)
{
$this->setupLayout('Edit page',array(),true);
@jlebrech
jlebrech / gist:809354
Created February 3, 2011 11:05
in the model
<?php
function save($id=null)
{
$this->title = $this->input->post('title');
$this->code = $this->input->post('code');
$this->permalink = $this->input->post('permalink');
if ($this->input->post("id")){ // is there an id
$this->modified = date('Y-m-d H:i:s'); // then it's modified
@jlebrech
jlebrech / commenting system spec
Created February 18, 2011 09:25
not really yaml
user:
has_many: comments => author
can_be: author, recipient
comment:
belongs_to_many: users => recipients
has_one: user => author
@jlebrech
jlebrech / gist:896090
Created March 31, 2011 09:15
freezing.
class Freeza # you can define a class once
def hello
puts "hello"
end
end
f = Freeza.new
f.hello
class Freeza # twice
@import "attributeEditController.j"
...
attribController = [[AttributeEditController alloc] initWithCibName:"attributeEditController" bundle:nil];
[verticalSplitter addSubview:[attribController view]];
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
CPWindow theWindow; //this "outlet" is connected automatically by the Cib
IBOutlet CPButtonBar buttonBar;
IBOutlet CPToolbar toolBar;
}