- 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');
<?php | |
if (!is_random_header_image()) { | |
$imagenes = get_uploaded_header_images(); | |
foreach ($imagenes as $imagen) { | |
$url = $imagen['url']; | |
echo '<img src="'.$url.'" height="'.get_custom_header()->height.'" width="'.get_custom_header()->width.'"/>'; | |
} | |
} else { | |
echo '<img src="'.get_header_image().'" height="'.get_custom_header()->height.'" width="'.get_custom_header()->width.'" alt="" />'; | |
} |
<?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.
var oldSync; | |
oldSync = Backbone.sync; | |
Backbone.sync = function(method, model, options) { | |
var csrfSafeMethod; | |
csrfSafeMethod = function(method) { | |
return /^(GET|HEAD|OPTIONS|TRACE)$/.test(method); | |
}; | |
options.beforeSend = function(xhr, settings) { | |
if (!csrfSafeMethod(settings.type) && !this.crossDomain) { |
<script id="courseList" type="text/x-handlebars-template"> <span id="course-option" class="course-opt" value="{{id}}">{{name}}</span> </script> | |
method: in main.js | |
window.templates = function(id) { return Handlebars.compile($('#' + id).html(), context); }; | |
then some of my code in my view | |
`App.Views.CourseView = Backbone.View.extend({ | |
tagName: 'option', |
<?php namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Contracts\Routing\Middleware; | |
use Illuminate\Http\Response; | |
class CORS implements Middleware { | |
/** | |
* Handle an incoming request. |
UPDATE: Not enough happy with step 3 and 4 (essentially because of some git errors), I figured out a cleaner solution: | |
New 3. Now, we will use a git-subtree technique to push the build or output content to the gh-pages branch. You will need to run the following lines every time you want to update your site/blog! | |
git checkout master # you can avoid this line if you are in master... | |
git subtree split --prefix output -b gh-pages # create a local gh-pages branch containing the splitted output folder | |
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin | |
git branch -D gh-pages # delete the local gh-pages because you will need it: ref |
$('body').on('click', '.ajax-modal', function() { | |
$('.ui.modal') | |
.modal({ | |
onShow: function(callback) { | |
callback = $.isFunction(callback) ? callback : function(){}; | |
var $content = $(this).find('.content'); | |
$.get("contentData.php", function(data) { | |
$content.html(data); | |
}); | |
} |