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
var Cart = (function(){ | |
var m = {}; | |
m.init = function(){ | |
jQuery(function(){ | |
m.add(); | |
m.update(); | |
m.delete(); | |
}); | |
}; |
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 | |
namespace App\Controllers; | |
class CompanyController | |
{ | |
public function edit() | |
{ | |
$company_id = $_POST['company_id']; |
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 | |
namespace App\Core; | |
class Container | |
{ | |
private $data; | |
public function set($key, $value) | |
{ |
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 | |
$action = isset($_GET['action']) ? 'insert'; | |
if($action == 'insert') { | |
//aqui faz a inserção | |
} | |
if($action == 'update') { | |
//aqui faz alteração |
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 $menu = [];?> | |
<?php foreach($items as $item) : ?> | |
<?php if(!in_array($item['menu'], $menu)) : ?> | |
<h3><?php echo $item['menu']?></h3> | |
<?php $menu[] = $item['menu'];?> | |
<?php endif;?> | |
<p><?php echo $item['subMenu']?></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
var loopGa = window.setInterval(function(){ | |
if(typeof ga !== 'undefined' ) { | |
ga('require', 'ec'); | |
ga('ec:addProduct', { | |
'id': '<?php echo $product_info["product_id"]?>', | |
'name': '<?php echo $product_info["name"]?>', | |
}); | |
ga('ec:setAction', 'detail'); | |
ga('send', 'pageview'); |
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 | |
namespace App\Models; | |
use Illuminate\Database\Eloquent\Model; | |
class Post extends Model | |
{ | |
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
//Pega todos os elementos q estão com .items | |
let links = document.querySelectorAll('.items'); | |
//Pecorre esse elemento | |
links.forEach(link => { | |
//Atribui ação a esse elemento | |
link.addEventListener('click', e => { | |
e.preventDefault(); | |
//pega todos os nomes da classe desse elemento | |
let names = link.className.split(' '); |
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 | |
$content = 'jbajdbfkjsd <img src="endereco/imagem1.jpg" /> | |
<img src="endereco/imagem2.jpg" /> | |
<img src="endereco/imagem3.jpg" /> | |
<img src="endereco/imagem4.jpg"/> | |
'; | |
preg_match_all('/src="([^"]*)"/mis',$content, $matches); |