Skip to content

Instantly share code, notes, and snippets.

Created Nov 26, 2011
What would you like to do?
Y'ALL Partials
class Auth extends CI_Controller {
public function __construct()
$this->load->spark('yall/0.2.0'); // not needed if autoloaded
public function login()
// your auth logic goes here...
$this->yall->set('title', 'Login') // $title in layout file
->partial('content', 'login') // $content in layout file
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8" />
<title><?php echo $title ?></title>
<link rel="stylesheet" href="screen.css" />
<h1>My App Name</h1>
<ul id="main-nav">
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
<div id="main-content">
<h2><?php echo $title ?></h2>
<?php echo $content ?>
<div id="footer">
&copy; Your Company Name.
<?php echo form_open() ?>
<?php echo form_label('email', 'Email address') ?>
<?php echo form_input('email') ?>
<?php echo form_label('password', 'Password') ?>
<?php echo form_password('password') ?>
<input type="submit" value="Login" />
<?php echo form_close() ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment