Created
November 26, 2011 14:29
-
-
Save akuzemchak/1395774 to your computer and use it in GitHub Desktop.
Y'ALL Partials
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Auth extends CI_Controller { | |
public function __construct() | |
{ | |
parent::__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 | |
->render(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title><?php echo $title ?></title> | |
<link rel="stylesheet" href="screen.css" /> | |
</head> | |
<body> | |
<h1>My App Name</h1> | |
<ul id="main-nav"> | |
<li><a href="/">Home</a></li> | |
<li><a href="/about">About</a></li> | |
</ul> | |
<div id="main-content"> | |
<h2><?php echo $title ?></h2> | |
<?php echo $content ?> | |
</div> | |
<div id="footer"> | |
© Your Company Name. | |
</div> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo form_open() ?> | |
<div> | |
<?php echo form_label('email', 'Email address') ?> | |
<?php echo form_input('email') ?> | |
</div> | |
<div> | |
<?php echo form_label('password', 'Password') ?> | |
<?php echo form_password('password') ?> | |
</div> | |
<div> | |
<input type="submit" value="Login" /> | |
</div> | |
<?php echo form_close() ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment