Skip to content

Instantly share code, notes, and snippets.

View jeffwinesett's full-sized avatar

Jeff Winesett jeffwinesett

View GitHub Profile
@jeffwinesett
jeffwinesett / application.controllers.SiteController.actionLogin().php
Created September 27, 2012 02:35
Yii Web Dev Book, Chapter 12, section: Adding a login message log
/**
* Displays the login page
*/
public function actionLogin()
{
Yii::trace("The actionLogin() method is being requested", "application.controllers.SiteController");
//if they are already logged in, redirect them to the home page
if(!Yii::app()->user->isGuest)
{
@jeffwinesett
jeffwinesett / application.migrations.create_system_message_table.php
Created September 26, 2012 00:28
Yii Web Dev Book, Chapter 11, section: Creating the database table
public function up()
{
//create the issue table
$this->createTable('tbl_sys_message', array(
'id' => 'pk',
'message' => 'text NOT NULL',
'create_time' => 'datetime DEFAULT NULL',
'create_user_id' => 'int(11) DEFAULT NULL',
'update_time' => 'datetime DEFAULT NULL',
'update_user_id' => 'int(11) DEFAULT NULL',
@jeffwinesett
jeffwinesett / application.views.layouts.main.php
Created September 25, 2012 10:14
Yii Web Dev Book, Chapter 10, section: Deconstructing the main.php layout file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<!-- blueprint CSS framework -->
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
<!--[if lt IE 8]>
@jeffwinesett
jeffwinesett / application.views.site.rev.login.php
Created September 25, 2012 03:38
Yii Web Dev Book, Chapter 10, section: Performing File Translation
<?php
$this->pageTitle='Nigol';
$this->breadcrumbs=array(
'Nigol',
);
?>
<h1>Nigol</h1>
<p>Slaitnederc nigol ruoy htiw mrof gniwollof eht tuo llif esaelp:</p>
@jeffwinesett
jeffwinesett / themes.newtheme.css.main.css
Created September 25, 2012 02:58
Yii Web Dev Book, Chapter 10, section: Creating a theme
body
{
margin: 0;
padding: 0;
color: #555;
font: normal 10pt Arial,Helvetica,sans-serif;
background: #d6d6d6 url(images/background.gif) repeat-y center top;
}
#page
@jeffwinesett
jeffwinesett / application.models.ProjectUserForm.php
Created September 25, 2012 02:45
Yii Web Dev Book, Chapter 7, section: Adding the new form model class
<?php
/**
* ProjectUserForm class.
* ProjectUserForm is the data structure for keeping
* the form data related to adding an existing user to a project. It is used by the 'Ad-duser' action of 'ProjectController'.
*/
class ProjectUserForm extends CFormModel
{
/**
* @var string username of the user being added to the project
@jeffwinesett
jeffwinesett / application.commands.RbacCommand.php
Created September 25, 2012 02:40
Yii Web Dev Book, Chapter 7, section: Writing a console application command
<?php
class RbacCommand extends CConsoleCommand
{
private $_authManager;
public function getHelp()
{