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
echo "<pre>"; print_r($variable); echo "</pre>"; | |
exit; |
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 | |
header('Content-type: text/plain; charset=utf-8'); | |
//declare the number of the post/photo in the $post_nmuber variable | |
$post_number = ''; | |
$list = file_get_contents('http://graph.facebook.com/v1.0/' . $post_number . '/likes?pretty=1&limit=600&after=MTAwMDAyNTI4ODAyMDYx'); | |
$array = json_decode($list); | |
foreach($array->data as $user){ |
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 TopicCommentsController extends \BaseController { | |
... | |
public function index() | |
{ | |
$topiccomments = Topiccomment::all(); | |
return View::make('topiccomments.index', compact('topiccomments')); |
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 | |
// app/config/app.php | |
return array( | |
.... | |
/* | |
|-------------------------------------------------------------------------- | |
| Application Locale Configuration | |
|-------------------------------------------------------------------------- | |
| | |
| The application locale determines the default locale that will be used |
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 BaseController extends Controller{ | |
... | |
public function setLocale($locale = Null) | |
{ | |
if(!$locale){ | |
$mLocale = Config::get( 'app.locale' ); | |
} | |
$mLocale = $locale; // Get parameter from URL. |
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 BaseController extends Controller{ | |
... | |
/** | |
* setting up the locale | |
* @param [type] $locale - the parameter from the URL with the locale | |
*/ | |
public function setLocale($locale = Null) | |
{ |
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 | |
// app/routes.php | |
Route::get('locale/{locale}', 'BaseController@setLocale' ); |
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 | |
// app/filters.php | |
App::before(function($request) | |
{ | |
// Set default locale. | |
$mLocale = Config::get( 'app.locale' ); | |
// Has a session locale already been set? | |
if ( !Session::has( 'locale' ) ) | |
{ |
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 UsersTableSeeder extends Seeder{ | |
public function run(){ | |
DB::table('users')->delete(); | |
$faker = Faker\Factory::create(); | |
for ($i = 0; $i < 100; $i++) |
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 CompaniesTableSeeder extends Seeder { | |
public function run() | |
{ | |
DB::table('companies')->delete(); | |
$faker = Faker\Factory::create(); |
OlderNewer