Skip to content

Instantly share code, notes, and snippets.

View converge's full-sized avatar

John Vanzuita converge

View GitHub Profile
<div id="menu">
<span class="logo_fortunata">
<?= $this->Html->image('logo_fortunata.png') ?>
</span>
</div>
--
#
# CSS
$routes->connect('/:category/:slug',
['controller' => 'Products', 'action' => 'view'],
['pass' => ['category', 'slug']]
);
public function view($category = null ,$slug = null) {
// call frontend layout
$this->layout = 'frontend';
if (! $slug) {
$this->Flash->success ( 'Invalid id for Product' );
$this->redirect ( '/products' );
}
<?php
setlocale(LC_ALL, 'pt_BR.UTF-8');
echo money_format('%n', h($product->PriceLists['price']));
?>
# resultado
17,20 R$
# preciso de:
$routes->connect('/:category/:slug',
['controller' => 'Products', 'action' => 'view'],
['pass' => ['category', 'slug']]
);
object(App\Model\Entity\Product) {
'new' => false,
'accessible' => [
'price_list_id' => true,
'category_id' => true,
'active' => true,
'price_list' => true,
'category' => true,
'order_lines' => true
ajax call
function login_acesso_lojista() {
var data = jQuery("#acesso_lojista_login").serialize();
jQuery.ajax({
type: "POST",
data: data,
url: "../users/login",
$this->autoRender = false;
if ($this->request->is('ajax')) {
$this->layout = 'ajax';
} else {
debug('pobrema');
}
public function login() {
$this->autoRender = false;
if ($this->request->is('ajax')) {
$this->layout = 'ajax';
} else {
debug('pobrema');
}
// create an order
$newOrder = TableRegistry::get('Orders');
$query = $newOrder->query();
$query->insert(['client_id', 'statuse_id'])
->values(['client_id' => $clientId->id,
'statuse_id' => 1])
->execute();