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 | |
| $db = new PDO('mysql:host=localhost;dbname=rmc2', 'root'); | |
| $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
| function benchmark($callback){ | |
| $start = microtime(true); | |
| for ($i = 0; $i < 100; $i++) | |
| $callback(); | |
| return microtime(true) - $start; | |
| } |
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
| select floor(20/100*(count(*))) as min, floor(80/100*(count(*))) as max | |
| from produto | |
| order by valor | |
| limit min, max; | |
| select min, max | |
| from (SELECT valor, floor(20/100*(count(*))) as min, floor(80/100*(count(*))) as max FROM produto group by fornecedor_id) produto | |
| order by valor | |
| limit 0, 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
| // included script. For example js/gridViewProceedCheckBoxes.js | |
| /** | |
| * [proceedCheckBoxes description] | |
| * @param {[type]} btnID [id of button] | |
| * @param {[type]} gridID [id of GridView] | |
| * @param {[type]} pjaxID [id of pjax-container] | |
| * @param {[type]} emptyAlertText [text for alert "Nothing Checked"] | |
| * @param {[type]} confirmAlertText [text for confirmation alert] | |
| * @param {[type]} proceedURL [controller action ro proceed] |
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 | |
| echo $form->field($model, 'posterImage')->widget(FileInput::classname(), [ | |
| 'options' => [ | |
| 'multiple' => true, | |
| 'accept' => 'image/*', | |
| ], | |
| 'pluginOptions' => [ | |
| 'maxImageWidth' => 265, | |
| 'maxImageHeight' => 376, | |
| 'minImageWidth' => 265, |
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
| https://github.com/yii2mod/yii2-google-maps-markers |
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
| http://stackoverflow.com/questions/42107022/yii2-gridview-custom-search-textbox |
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
| http://stackoverflow.com/questions/42164542/yii2-display-selected-values-in-multiple-select-dropdown |
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
| // make a comma delimited list | |
| $string = join(',', $array); | |
| Or loop yourself: | |
| $string = ''; | |
| foreach ($array as $key => $value) { | |
| $string .= ",$value"; | |
| } |
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
| Definitation doc | |
| * @author me | |
| * @version 0.1 | |
| * @package application.components | |
| * @param string $bar param description {@link DummyClassB} | |
| * @return DummyClassA | |
| * @var | |
| * @inheritdoc => | |
| @throws NotFoundHttpException if the model cannot be found |
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
| /* Reset */ | |
| html, | |
| body { | |
| height: 100%; | |
| } | |
| body { | |
| margin: 0; | |
| padding: 0; |
NewerOlder