- view/index.blade.php
{{ Form::open(['url' => '/profile', 'method' => 'get']) }}
{{ Form::text('user', null, ['id'=>'users']) }}
{{ Form::submit('GO') }}
{{ Form::close() }}
- routes.php
Route::get('/', 'SearchController@index');
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
<?php | |
class Widget_Name extends WP_Widget { | |
function Widget_Name() { | |
$widget_opts = array( | |
'classname' => 'your-awesome-class', | |
'description' => 'Your awesome Description', | |
); | |
{{ Form::open(['url' => '/profile', 'method' => 'get']) }}
{{ Form::text('user', null, ['id'=>'users']) }}
{{ Form::submit('GO') }}
{{ Form::close() }}
Route::get('/', 'SearchController@index');
Use case: Database entries are represented in a table. By grabbing and moving a row up or down the table, you can change the entries' order/position. The changes are submitted automatically via ajax.
<?php namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Contracts\Routing\Middleware; | |
use Illuminate\Http\Response; | |
class CORS implements Middleware { | |
/** | |
* Handle an incoming request. |
<?php if (($wp_query->current_post +1) == ($wp_query->post_count)) { | |
echo 'This is the last post'; | |
} ?> | |
<?php if (($wp_query->current_post +1) != ($wp_query->post_count)) { | |
echo 'This is the not the last post'; | |
} ?> |
<div id="unique-id" style="display:none;"> | |
<div class="popover-heading">This is a heading</div> | |
<div class="popover-body">This is HTML content that will be loaded inside a </div> | |
</div> | |
<span tabindex="0" role="button" data-toggle="popover" data-placement="bottom" data-popover-content="#unique-id"> | |
Click me to load a popover | |
</span> |
/* | |
Template literals forEach example | |
Using Array.map(), we can create a forEach within template literals. | |
*/ | |
var items = [ | |
{ name: 'Teddy' }, | |
{ name: 'Dolores' }, | |
{ name: 'William' }, | |
{ name: 'Bernard' } |
<?php | |
// GET | |
$request = $client->get($url, array('Accept' => 'application/json')); | |
$response = $request->send(); | |
if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) { | |
// Error | |
} |