Here's how I setup Laravel on MAMP:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
<?php | |
/********************************************************************************************* | |
* Example usage (In view) | |
* <div class="welcome"> | |
<?php echo Form::open(array('route'=>'process','class'=>'form-horizontal'))?> | |
<?php echo Form::textField('first_name')?> | |
<?php echo Form::textField('last_name')?> | |
<?php echo Form::emailField('email')?> | |
<?php echo Form::passwordField('password')?> | |
<?php echo Form::selectField('select_one', array('1'=>'abc', '2'=>'def'))?> |
<?php | |
/** | |
* File: SimpleImage.php | |
* Author: Simon Jarvis | |
* Modified by: Miguel Fermín | |
* Based in: http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php | |
* | |
* This program is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU General Public License | |
* as published by the Free Software Foundation; either version 2 |
<?php | |
class Model_Student_Profile extends ORM { | |
/** | |
* Model validation rules | |
*/ | |
public function rules() | |
{ | |
return array( |
<?php | |
class DateFormat { | |
const DATE_SHORT = 'Y-m-d'; | |
const DATE_LONG = 'F j, Y'; | |
const DATETIME_SHORT = 'Y-m-d H:i'; | |
const DATETIME_LONG = 'F j, Y, g:i a'; |
# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
<snippet> | |
<content><![CDATA[ | |
// ${1} Resource | |
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index')); | |
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show')); | |
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new')); | |
Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit')); | |
Route::post('${1}s', '${1}s@create'); | |
Route::put('${1}s/(:any)', '${1}s@update'); | |
Route::delete('${1}s/(:any)', '${1}s@destroy'); |
public static function read_search($terms, $limit = 10) | |
{ | |
$contact_results = DB::query(" | |
select * | |
from contacts | |
where `account_user_id`=? | |
and `deleted`='0' | |
and `marketing`='0' | |
and `mass_merge`='0' | |
and match (`first`, `last`) against (?) |