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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
/** | |
* Подстовляем дефис в интервал десятичных чисел | |
* *1, 1.2, 1.3, 1.4, 2, 3 => result 1-1.4, 2, 3* | |
* | |
* @param $array | |
* @param bool $str если TRUE возврощать будет страку | |
* | |
* @return array|string | |
*/ | |
public static function spacing($array, $str = FALSE) |
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
<?=$form->field($offer, 'categories_list')->dropDownList( | |
ArrayHelper::map($categories,'id',function($value){ return str_repeat('-',count(explode('.',$value->path) )) . $value->name ;} ), | |
['multiple' => true]); | |
?> |
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
document.getElementById('google_preview').innerHTML = '<span class="google_preview_title">' + document.getElementById('theme_metatitle').value + '</span><br/><span class="google_preview_seo_url">'+ domain_name_short + script_url + seo_url + '</span><br/><span class="google_preview_page_description">'+ document.getElementById('theme_metadescription').value+'</span>'; | |
var img_id = 'google_preview_img'; | |
if(typeof jQuery('#'+img_id).data('qtip') == 'object') | |
{ | |
var api = jQuery('#'+img_id).qtip("api"); | |
change_google_preview(); | |
} | |
else | |
{ | |
jQuery('#'+img_id).qtip({ |
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 | |
if (!function_exists('array_column')) { | |
function array_column(array $array, $columnKey, $indexKey = null) | |
{ | |
$result = array(); | |
foreach ($array as $subArray) { | |
if (!is_array($subArray)) { | |
continue; | |
} elseif (is_null($indexKey) && array_key_exists($columnKey, $subArray)) { | |
$result[] = $subArray[$columnKey]; |
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
$script = <<< JS | |
//some script | |
JS; | |
//маркер конца строки, обязательно сразу, без пробелов и табуляции | |
$this->registerJs($script, yii\web\View::POS_READY); | |
// POS_HEAD | |
// POS_BEGIN: после тэга <body> | |
// POS_END: перед тэгом </body> | |
// POS_LOAD: оборачивается в jQuery(window).load(). Note that by using this position, the method will automatically register the jQuery js file. |
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
/* --- DEBUG ---*/ | |
/* подсвечиваем теги без необходимых атрибутов */ | |
img:not([alt]), | |
label:not([for]), | |
input[type=submit]:not([value]) { | |
outline:2px solid red; | |
} |
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
url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFklEQVR42mJydnb+DwQMjCACBAACDABTiAfG7AT+jQAAAABJRU5ErkJggg==) #282828 |
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
@include('partials.sidebar') | |
To pass the data the sidebar needs (in AppServiceProvider boot method) : | |
view()->composer('partials.sidebar', function ($view) { | |
// Get the $data | |
$view->with('data', $data); |
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
<label for="">Rubric</label> | |
<select name="category_id" id="category_id" class="ui dropdown"> | |
<option class="item" value="" disabled selected="">Выберите категорию...</option> | |
@foreach($categories as $item) | |
@if($item->children->count() > 0) | |
<option class="item select-option-label" value="{{$item->id}}">{{ $item->name }}</option> | |
@foreach($item->children as $submenu) | |
<option class="item" value="{{$submenu->id}}">- {{ $submenu->name }}</option> | |
@endforeach | |
@else |
OlderNewer