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
| $years = range(2000, date("Y")); | |
| $this->widgetSchema['start_date'] = new sfWidgetFormFilterDate(array( | |
| 'from_date' => new sfWidgetFormDate(array('years' => array_combine($years, $years))), | |
| 'to_date' => new sfWidgetFormDate(array('years' => array_combine($years, $years))), | |
| 'with_empty' => false, | |
| 'template' => 'from %from_date% to %to_date%', | |
| )); |
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 MyFormFilter extends BaseMyFormFilter{ | |
| public function doBuildQuery(array $values){ | |
| $query = parent::doBuildQuery($values); | |
| $query->leftJoin($query->getRootAlias().".Translation t"); | |
| return $query; | |
| } |
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 MyFormFilter extends BaseMyFormFilter{ | |
| public function configure(){ | |
| $this->widgetSchema['areas_conhecimento'] = | |
| new sfWidgetFormChoice(array( | |
| 'expanded' => true, | |
| 'choices' => Doctrine_Core::getTable('MyTable')->getAreasConhecimento(), | |
| )); | |
| } |
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
| $(function(){ | |
| $("#frmCadastro").relatedSelects({ | |
| onChangeLoad: 'retornaDados.php', | |
| loadingMessage: 'Carregando, por favor aguarde...', | |
| selects: ['cenId', 'curId', 'disId'], | |
| disableIfEmpty: true, | |
| onEmptyResult: function(){ | |
| alert('Não existem opções disponíveis para ' + $(this).find('option:selected').text() + '!'); | |
| } | |
| }); |
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
| // symfony 1.2 | |
| public function setup(){ | |
| sfValidatorBase::setRequiredMessage('O campo é obrigatório'); | |
| sfValidatorBase::setInvalidMessage('O campo é inválido'); | |
| parent::setup(); | |
| } | |
| // symfony 1.4 |
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
| date("d/m/Y", mktime(0, 0, 0, date("m"), date("d")+5, date("Y"))); // formato DD/MM/AAAA - data atual + 5 dias |
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>Example: Geolocation using W3C Geolocation API</title> | |
| <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
| <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> | |
| <script type="text/javascript"> | |
| function initialize(){ | |
| var myOptions = { zoom: 8, mapTypeId: google.maps.MapTypeId.HYBRID }; | |
| var map = new google.maps.Map(document.getElementById("map"), myOptions); |
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
| <div class="ui-corner-all"> | |
| <?php foreach($form->getFormFieldSchema() as $formField): ?> | |
| <div class="form_field_<?php echo $formField->getName() ?><?php $formField->hasError() and print ' ui-state-error ui-corner-all' ?>"> | |
| <div class="label ui-helper-clearfix"> | |
| <?php echo $formField->renderLabel(); ?> | |
| </div> | |
| <?php if($help = $formField->renderHelp()): ?> | |
| <div class="help"> | |
| <span class="ui-icon ui-icon-help floatleft"></span> |
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
| $ git checkout master | |
| $ git remote add username git://github.com/username/repo.git | |
| $ git fetch username | |
| $ git merge username/master | |
| $ git push origin master |
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
| #mydiv ul { | |
| margin-left: 0; | |
| padding-left: 0; | |
| display: inline; | |
| } | |
| #mydiv ul li { | |
| margin-left: 0; | |
| padding-left: 2px; | |
| list-style: none; |