Skip to content

Instantly share code, notes, and snippets.

View pedroelsner's full-sized avatar

Pedro R. Elsner Begosso pedroelsner

View GitHub Profile
@pedroelsner
pedroelsner / gist:3073831
Created July 9, 2012 02:06
#2 - Rewirte WordPress
<?php
$my_rewrite_rules_array = array(
"livros/autor/([^/]+)$" => 'index.php?custom_page=livros&autor=$matches[1]',
);
@pedroelsner
pedroelsner / gist:3073814
Created July 9, 2012 02:01
#1 - Rewrite WordPress
<?php
$my_rewrite_rules_array = array(
"contato$" => 'index.php?custom_page=contato',
);
<?php
$soap = new SoapClient("http://webob.XXXXXXXXX.com.br/wsVolksTeste/Volks.asmx?wsdl");
echo '<b>Lista funções do webservice:</b><br />';
$functions = $soap->__getFunctions();
var_dump($functions);
echo '<br /><br />';
try{
@pedroelsner
pedroelsner / gist:3067234
Created July 7, 2012 17:11
#2 - Agregação de Filtros - Filter Results
<?php
$this->FilterResults->addFilters(
array(
'OR' => array(
'filter1' => array(
'User.name' => array('operator' => 'LIKE'),
'User.active' => array('value' => '1')
)
'filter2' => array(
'User.username' => array('operator' => 'LIKE')
@pedroelsner
pedroelsner / gist:3067223
Created July 7, 2012 17:09
#1 - Agregação de Filtros - Filter Results
<?php
$this->FilterResults->addFilters(
array(
'filter1' => array(
'User.name' => array('operator' => 'LIKE')
)
'filter2' => array(
'User.username' => array('operator' => 'LIKE')
)
)
@pedroelsner
pedroelsner / gist:3048286
Created July 4, 2012 16:48
#10 - FilterResults CakePHP 2.2
<?php
array(
'LIKE' => __('contendo', true),
'NOT LIKE' => __('não contendo', true),
'LIKE BEGIN' => __('começando com', true),
'LIKE END' => __('terminando com', true),
'=' => __('iqual a', true),
'!=' => __('diferente de', true),
'>' => __('maior que', true),
'>=' => __('maior ou igual', true),
@pedroelsner
pedroelsner / gist:3048272
Created July 4, 2012 16:47
#9 - FilterResults CakePHP 2.2
<?php
echo $this->FilterForm->create();
echo $this->FilterForm->selectFields('filter1',
array(
'User.id' => __('ID', true),
'User.name' => __('Nome', true),
'User.username' => __('Usuário', true),
),
array(
@pedroelsner
pedroelsner / gist:3048270
Created July 4, 2012 16:46
#8 - FilterResults CakePHP 2.2
<?php
echo $this->FilterForm->create();
echo $this->FilterForm->selectFields('filter1', null, array('class' => 'select-box'));
echo $this->FilterForm->selectOperators('filter1');
echo $this->FilterForm->input('filter1');
echo $this->FilterForm->end(__('Filtrar', true));
@pedroelsner
pedroelsner / gist:3048260
Created July 4, 2012 16:44
#7 - FilterResults CakePHP 2.2
<?php
echo $this->FilterForm->create();
echo $this->FilterForm->input('filter2', array('class' => 'select-box'));
echo $this->FilterForm->input('filter1');
echo $this->FilterForm->end(__('Filtrar', true));
@pedroelsner
pedroelsner / gist:3048253
Created July 4, 2012 16:43
#6 - FilterResults CakePHP 2.2
<?php
$this->FilterResults->addFilters(
array(
'filter1' => array(
'User.name' => array('operator' => 'LIKE'),
'User.active' => array('value' => '1')
)
)
);