This file contains hidden or 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 WP_CustomPagination | |
{ | |
protected $args = array(); | |
protected $wp_query, $paged, $pages, $range, $showItens, $element = null; | |
public static $argsDefault = array( | |
'before' => '<ul class="pagination %1$s">', | |
'after' => '</ul>', |
This file contains hidden or 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
{ | |
"name": "meunome/meutema", | |
"description": "minha descricao", | |
"license": "proprietary", | |
"authors": [{ | |
"name": "Vinicius Reis", | |
"email": "[email protected]" | |
}], | |
"require": { | |
"potterywp/potter": "dev-master" |
This file contains hidden or 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
$image = Input::file('im'); | |
$model = new \Artesaos\Attacher\AttacherModel(); | |
$model->setupFile($image); | |
$model->save(); |
This file contains hidden or 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
# app/http/controllers/front | |
<?php namespace App\Http\Controllers\Front; | |
use App\Http\Controllers; | |
abstract class FrontCtrl extends Controllers | |
{ | |
} |
This file contains hidden or 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
# app/http/controllers/Front/FrontCtrl.php | |
<?php namespace App\Http\Controllers\Front; | |
use App\Http\Controllers\Controller; | |
abstract class FrontCtrl extends Controller | |
{ | |
# implemente as suas regras e/ou métodos que serão válidas/usadas em todos os controllers do seu "front" | |
} |
This file contains hidden or 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
# app/http/controllers/Painel/PainelCtrl.php | |
<?php namespace App\Http\Controllers\Painel; | |
use App\Http\Controllers\Controllers; | |
abstract class PainelCtrl extends Controller | |
{ | |
# implemente as suas regras e/ou métodos que serão válidas/usadas em todos os controllers do seu "painel" | |
} |
This file contains hidden or 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 | |
# Estendendo PainelCtrl e FrontCtrl você mantem seu sistema organizado, | |
# podendo implementar regras comuns aos seus controllers, deixando seu código mais legivel e flexivel | |
# Controller 1 (Painel) | |
# app/http/controllers/Painel/ClientsCtrl.php | |
namespace App\Http\Controllers\Painel; | |
class ClientsCtrl extends PainelCtrl {} |
This file contains hidden or 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 | |
// Painel (ADMIN) | |
Route::group(['prefix' => 'painel', 'namespace' => 'Painel'], function() | |
{ | |
Route::get('posts', ['as' => 'painel.posts.index', 'uses' => 'PostsCtrl@index']); // App/Http/Controllers/Painel/Posts.php | |
Route::get('posts/{id}', ['as' => 'painel.posts.show', 'uses' => 'PostsCtrl@show']); | |
}); | |
// Front (Site) |
This file contains hidden or 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 | |
## resource ## | |
Route::group(['prefix' => 'painel', 'namespace' => 'Painel'], function() | |
{ | |
Route::resource('posts', 'PostsCtrl'); | |
# Gera | |
# | |
# painel.posts.index # painel.posts.show # painel.posts.create | |
# painel.posts.store # painel.posts.update # painel.posts.destroy |