This file contains 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
>rails new demo | |
create | |
create README.rdoc | |
create Rakefile | |
create config.ru | |
create .gitignore | |
create Gemfile | |
create app | |
create app/assets/images/rails.png | |
create app/assets/javascripts/application.js |
This file contains 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
<html> | |
<head> | |
<title><?=$title; ?></title> | |
</head> | |
<body> | |
<? if($loggedIn = true): ?> | |
<p>You're logged in!</p> | |
<? else: ?> | |
<p>You're not logged in!</p> | |
<? endif; ?> |
This file contains 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
<html> | |
<head> | |
<title>{$title}</title> | |
</head> | |
<body> | |
{if ($loggedIn = true)} | |
<p>You're logged in!</p> | |
{else} | |
<p>You're not logged in!</p> | |
</body> |
This file contains 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
#include "SDL/SDL.h" | |
#include "SDL/SDL_image.h" | |
#include <string> | |
// screen atributes | |
const int SCREEN_WIDTH = 640; | |
const int SCREEN_HEIGHT = 480; | |
const int SCREEN_BPP = 32; | |
// surfaces |
This file contains 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
$username = NULL; | |
$password = NULL; | |
$email = NULL; | |
foreach($_POST as $key => $var){ | |
$$key = $var; | |
} |
This file contains 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 Admin extends Controller{ | |
function __construct(){ | |
var_dump($this->load); | |
$this->load->model("admin/admin.php"); | |
} |
This file contains 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 Welcome extends Controller{ | |
public function index(){ | |
var_dump($this->load); | |
$this->load->model('welcome'); | |
$data = array('title' => 'Hellow', 'greeting' => $this->welcome->greeting); | |
$this->load->view('welcome/index', $data); | |
} | |
} |
This file contains 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 Controller{ | |
function __construct(){ | |
global $config; | |
$this->load = new Load($this); | |
} | |
} |
This file contains 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 Controller{ | |
function __construct(){ | |
global $config; | |
$this->load = new Load($this); | |
} | |
} |
This file contains 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 Load{ | |
function __construct($object){ | |
$this->object = $object; | |
} | |
// loads a specified model | |
public function model($model){ | |
$model = strtolower($model); |
OlderNewer