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
<select> | |
<?php $first = false; | |
for($t = 12; $t<=23; $t++): ?> | |
<?php for($m = 0; $m<=45; $m+=15): ?> | |
<?php $m = $m == 0 ? sprintf("%02s", $m): $m; ?> | |
<option value="<?php echo ($t == 12 && !$first ? '00' : ($t < 10 ? '0'.$t : $t)).':'.$m.':00'; ?>"> | |
<?php echo $t > 12 ? ($t-12 == 0 ? 12 : $t-12).':'.($m).' PM' : $t.':'.$m.' AM'; ?> | |
</option> | |
<?php endfor; ?> | |
<?php if($t == 12 && !$first){ |
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
/** | |
* Twitter Bootstrap .hidden class can cause unexpected results | |
* when interacting with the jQuery .show() function. | |
* | |
* Extend the native jQuery show functionality to remove | |
* the hidden class when .show() is called. | |
**/ | |
(function($) | |
{ | |
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
<!-- PAGE RESULT --> | |
{% if item.url contains '/pages/' %} | |
<h1>PAGE</h1> | |
{% endif %} | |
<!-- BLOG RESULT --> | |
{% if item.url contains '/blogs/' %} | |
<h1>BLOG</h1> | |
{% endif %} |
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
//Yii pagination | |
.pager { | |
.yiiPager { | |
li { | |
&.page { | |
} |
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
<?=ucwords( implode(' ', preg_split('/(?=[A-Z])/',$str) ) ); ?> |
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 | |
//View Location to auto load all .php files | |
$viewLocation = 'admin/variantRules/options'; | |
//PHP glob function will return array. If there is an error double check your path | |
foreach (glob( Yii::app()->basePath."/views/".$viewLocation."/*.php") as $filename) | |
{ | |
//Render every partial and load data | |
$this->renderPartial('//'.$viewLocation.'/'. str_replace('.php', '', array_pop( explode('/',$filename) ) ), array() ); | |
} |
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
/** | |
Reference ONLY! Variables should be included elsewhere. | |
$small-lower:'767px'; | |
$medium-lower:'991px'; | |
$large-lower:'1199px'; | |
**/ | |
/** | |
Build Alignment Based on Breakpoints | |
**/ |
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
/** | |
Reference ONLY! Variables should be included elsewhere. | |
$small-lower:'767px'; | |
$medium-lower:'991px'; | |
$large-lower:'1199px'; | |
**/ | |
/** | |
Floats Based on BreakPoints | |
**/ |
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
.grid-view { | |
.summary { | |
} | |
.items { | |
thead { |
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
/** | |
* Map any model attribute to another model attribute | |
* AR hasAttribute() required vs property_exist() | |
* @param $model1 | |
* @param $model2 | |
* @param $map array('id'=>'sku') The sku of the second model would map to the id of the first model | |
* @return array | |
*/ | |
function mapModelToModel($model1, $model2, $map) { | |
foreach ($map as $attr1 => $attr2) { |
OlderNewer