# 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
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 | |
// Forked from: http://paste.laravel.com/4iV | |
public function get_reset_password() | |
{ | |
// render the reset password view | |
return View::make('auth.reset-password'); | |
} | |
public function post_reset_password() | |
{ |
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
<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'); |
A list of amazingly awesome PHP libraries that you should be using:
- Composer/Packagist - A package and dependency manager.
- Symfony2 - A framework comprised of individual components.
- Zend Framework 2 - Another framework of individual components.
- Symfony2 Components - The components that make Symfony2.
- Aura Components - A package of PHP 5.4 components.
- Silex - A micro framework built around Symfony2 components.
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 | |
// Resizer and Image Manipulation | |
// Based on: http://forums.laravel.com/viewtopic.php?id=2648 | |
public function post_edit_logo($id) | |
{ | |
$rules = array( | |
'image' => 'image', | |
); |
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
Based on: http://forums.laravel.com/viewtopic.php?id=2650 | |
Question: | |
Hi friends, | |
I have just started with laravel (beautiful product) and have a question about table relationships. | |
I have three tables (projects / articles / images) |
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 | |
//Source: http://forums.laravel.com/viewtopic.php?id=2807 | |
Route::get('optgroup', function() | |
{ | |
$eat_options = array( | |
'animals' => array( | |
'cats', | |
'dogs', | |
'monkeys', |
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
// Source URL: http://forum.ceviz.net/php/121070-veritabani-bilgileri-include-etmek.html#post711169 | |
File to read (readme.php) contents: | |
; <?php exit; ?> DO NOT DELETE THIS LINE | |
dbhost="localhost" | |
dbport="3306" | |
dbuser="root" | |
dbpass="" | |
dbname="webtrees" |
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 | |
function tarihFarki($startDate, $endDate) | |
{ | |
$startDate = strtotime($startDate); | |
$endDate = strtotime($endDate); | |
if ($startDate === false || $startDate < 0 || $endDate === false || $endDate < 0 || $startDate > $endDate) | |
return false; | |
$years = date('Y', $endDate) - date('Y', $startDate); | |