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 | |
| // esta classe contém mais linhas, limpei ela só para servir de exemplo... | |
| namespace Base\Controller; | |
| abstract class CrudController extends AbstractActionController { | |
| public function indexAction(){ | |
| $registros = array(); | |
| /* no meu caso eu recebo o $this->grid['campos] de outro controller | |
| mas isso poderia ser resolvido desta forma $capmosGrid = array('id','nome','email') |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8 /> | |
| <script src="http://code.jquery.com/jquery-2.0.2.min.js"></script> | |
| <script> | |
| jQuery(document).ready(function($) { | |
| $('.produtos input').change(function () { | |
| var total = $(this).closest('div').find('.quantidade').val() * $(this).closest('.produtos').find('.valor').val(); | |
| $(this).closest('.produtos').find('.resultado').val(total); |
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 | |
| /** | |
| * Preciso substituir todos os valores 'null' do array para 0 | |
| */ | |
| $data = array( | |
| 'fusca' => null, | |
| 'gol' => null, | |
| 'voyage' => 2, |
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 | |
| /* Se listar todos os números naturais inferiores a 10 que são múltiplos de 3 ou 5, temos 3, 5, 6 e 9. A soma desses múltiplos é de 23. | |
| * Encontre a soma de todos os múltiplos de 3 ou 5 abaixo de 1000. | |
| */ | |
| $soma = 0; | |
| for ($i=1; $i<1000; $i++) { | |
| $soma = (!($i%3) || !($i%5)) ? $soma+$i; | |
| } |
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
| <html> | |
| <head> | |
| <title>Canção do Exílio</title> | |
| <meta charset="utf8" /> | |
| <script> | |
| var frase = "Minha terra tem palmeiras,<br>Onde canta o Sabiá;<br>As aves que aqui gorjeiam,<br>Não gorjeiam como lá.<br><br>Nosso céu tem mais estrelas,<br>Nossas várzeas têm mais flores,<br>Nossos bosques têm mais vida,<br>Nossa vida mais amores.<br><br>Em cismar, sozinho, à noite,<br>Mais prazer encontro eu lá;<br>Minha terra tem palmeiras,<br>Onde canta o Sabiá.<br><br>Minha terra tem primores,<br>Que tais não encontro eu cá;<br>Em cismar - sozinho, à noite -<br>Mais prazer encontro eu lá;<br>Minha terra tem palmeiras,<br>Onde canta o Sabiá.<br><br>Não permita Deus que eu morra,<br>Sem que eu volte para lá;<br>Sem que desfrute os primores<br>Que não encontro por cá;<br>Sem que ainda aviste as palmeiras,<br>Onde canta o Sabiá.", | |
| i = 0; | |
| window.requestAnimFrame = (function () { | |
| return window.requestAnimationFrame; |
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 | |
| namespace Sessao\Entity; | |
| use Doctrine\ORM\Mapping as ORM; | |
| use Zend\Stdlib\Hydrator; | |
| /** | |
| * @ORM\Entity | |
| * @ORM\Table(name="sessao") |
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 A { | |
| public function foo() { | |
| echo "foo"; | |
| } | |
| } | |
| class B extends A { | |
| public function foo() { |
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
| { | |
| "bold_folder_labels": true, | |
| "caret_style": "phase", | |
| "color_scheme": "Packages/Color Scheme - Default/Mac Classic.tmTheme", | |
| "font_face": "Source Code Pro", | |
| "font_size": 14.0, | |
| "highlight_line": true, | |
| "theme": "Soda Light.sublime-theme", | |
| "translate_tabs_to_spaces": true | |
| } |
OlderNewer