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
(function( global, factory ) { | |
if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { | |
module.exports = factory(global); | |
} else if (typeof define === 'function' && define.amd) { | |
define([], function() { | |
return factory(global); | |
}); | |
} else { | |
global.Utilitarios = factory(global); | |
} |
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 | |
$token_list = array('_4as82-6assda79sasg_da7s39sa3f32ar6rta' => true,'s796as7dafsdf67d60s9s_df7das67d-796f' => false); | |
$app->hook( | |
'slim.before.router', | |
function () use ($app, $token_list) { | |
$req = $app->request(); | |
$current_path = $req->getPathInfo(); | |
if (!empty($current_path) && $current_path != '/') { | |
$access_token = $req->get('access_token'); | |
if (!isset($token_list[$access_token]) || $token_list[$access_token] !== true) { |
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 | |
$record = array( | |
array( | |
'id' => 1, | |
'titulo' => 'Post 1', | |
'descricao' => 'Este é o meu primeiro post :D' | |
), | |
array( | |
'id' => 2, | |
'titulo' => 'Post 2', |
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 Model | |
{ | |
/* armazena os dados retornado do banco de dados */ | |
private $data; | |
/* construtor */ | |
public function __construct($data) | |
{ | |
$this->data = $data; |
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
{# | |
time can be any string acceptable by http://www.php.net/strtotime, the | |
template will output that time's month. | |
If you don't want to pass in a date you can set time like this: | |
{% set time = "now"|date("U") %} | |
{% set time = "December 2012"|date("U") %} | |
How ever you want to output items onto the calendar is a different issue, | |
but I'd assume pushing everything into an array numerically indexed by that day: |
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
-- Example of how to include an if conditional in a where clause | |
-- We only want rows where a = 1 or 2 but only a = 2 if b = 4 | |
-- table structure: | |
-- [ a | b ] | |
-- 1 4 | |
-- 2 4 | |
-- 1 5 | |
-- 3 9 | |
-- 2 7 |
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 do painel de administração do tema | |
* @author Rodolfo Silva <contato@rodolfosilva.com> | |
* @link http://rodolfosilva.com | |
*/ | |
class ThemeAdmin | |
{ | |
public function __construct() | |
{ |
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 | |
/** | |
* Layout do painel | |
*/ | |
public function theme_config_page() | |
{ | |
?> | |
<div class="wrap"> | |
<h2>Configurações do tema</h2> | |
<p>Pequena descrição sobre o tema e o painel de configurações do tema</p> |
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 | |
include_once TEMPLATEPATH . '/partials/admin.php'; | |
$theme_admin = new ThemeAdmin(); |
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 do painel de administração do tema | |
* @author Rodolfo Silva <contato@rodolfosilva.com> | |
* @link http://rodolfosilva.com | |
*/ | |
class ThemeAdmin | |
{ | |
private $title = 'Configurações do meu tema'; | |
private $name_id = 'config_theme'; |