Work for/with/on
Philosophy
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<h1>Hello, world!</h1>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
</body>
</html>
write less, do more
var http = new XMLHttpRequest();
var wait = 0;
if (http.readyState == 4 || http.readyState == 0) {
http.open("GET", oafoptions["url"] + "?" + "command=Check+Dates&contactID=" + oafoptions["contactID"], true);
http.onreadystatechange = function() {
if (http.readyState == 4) {
var Date = http.responseXML.getElementsByTagName("Date");
for (var i = 0; i < Date.length; i++) {
showday(Date[i].firstChild.nodeValue);
delayPopulateDate(Date[i].firstChild.nodeValue);
}
}
}
http.send(null);
}
$(document).on("ready", function() {
var request = $.ajax({
url: oafoptions["url"],
type: "get",
data: {
command: "Check Dates",
contactID: oafoptions["contactID"]
},
dataType: "json"
});
request.done(function(data) {
// do something
});
});
# rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
# yum install php55w
Install Composer
# curl -sS https://getcomposer.org/installer | php
# mv composer.phar /usr/local/bin/composer
Create your Laravel Project
# cd /var/www/html
# composer create-project laravel/laravel your-project-name --prefer-dist
app/models/Task.php
<?php
class Task extends Eloquent {
public function users() {
return $this->belongsTo("User", "user_id");
}
}
app/models/User.php
<?php
class User extends Eloquent {
public function tasks() {
return $this->hasMany("Task");
}
}
app/routes.php
Route::get("tasks", function() {
// find tasks belonging to user id 1
$tasks = User::find(1)->tasks;
return View::make("tasks.index")->with("tasks", $tasks);
});
app/views/tasks/index.blade.php
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Tasks List</title>
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/font-awesome.min.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="row">
<div class="col-sm-12">
<h3>Tasks List</h3>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<table class="table table-striped">
<tbody>
<tr><th>Task Name</th><th>Description</th><th>Due Date</th></tr>
@foreach ($tasks as $task)
<tr>
<td>{{ $task->name }}</td>
<td>{{ $task->description }}</td>
<td>{{ date("r", strtotime($task->duedate)) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
<script src="/js/jquery-1.11.1.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
</body>
</html>