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
| $('selector').mousedown(function(event) { | |
| console.log(event.which); | |
| //1 - left button mouse click | |
| //2 - middle button mouse click | |
| //1 - right button mouse click | |
| }); |
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
| 100 – Thin || Hairline | |
| 200 – Extra Light || Ultra Light || Thin | |
| 300 – Light | |
| 400 – Normal || Regular | |
| 500 – Medium | |
| 600 – Semi Bold || Demi Bold | |
| 700 – Bold | |
| 800 – Extra Bold || Ultra Bold || Heavy |
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://forum.yiiframework.com/t/how-to-trim-a-field-for-a-model/34467 | |
| public function rules() | |
| { | |
| return [i | |
| [['engl', 'ru'], 'filter', 'filter' => 'trim'], | |
| ]; | |
| } |
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 | |
| // registered in file functions | |
| add_action( 'after_setup_theme', 'theme_register_nav_menu' ); | |
| // register_nav_menu( $location, $description ); | |
| function theme_register_nav_menu() { | |
| register_nav_menu( 'primary', 'Primary Menu' ); | |
| // register_nav_menus( array( $location => $description ) ); with version 3.0 |
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 | |
| use yii\data\Pagination | |
| //Controller action | |
| public function actionIndex() | |
| { | |
| $query = Article::find()->where(['status' => 1]); | |
| $countQuery = clone $query; | |
| $pages = new Pagination(['totalCount' => $countQuery->count(), 'pageSize' => 5]); | |
| $models = $query->offset($pages->offset) |
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 | |
| //need echo | |
| site_url(); //home page | |
| site_url('contacts'); //http://sitename/contacts | |
| get_template_directory_uri(); //echo | |
| home_url($path, $scheme); //https://wp-kama.ru/function/home_url |
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
| <!-- create theme --> | |
| <a href="https://www.youtube.com/watch?v=URFhyvZTENc&list=PL3LQJkGQtzc6Nwz67GGrMdqxim1c0H5DC&index=2">glo academy</a><br> | |
| wp_content > themes > <folder theme> > style.css > /*Theme Name: test*/ | |
| <!-- files need --> | |
| style.css | |
| index.php | |
| screenshot.png (1200px / 900 px) <!-- for show in console --> |
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 | |
| // get last key of array | |
| // for php 7 | |
| echo array_key_last ($array); | |
| // for php 5 | |
| // numeric array | |
| echo $array[count($array) - 1]; |
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 | |
| <?= $form->field($model, 'GrossPay')->textInput(['id'=>'GrossPay','readonly'=> true])?> |
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 css ... | |
| function watchSass() { | |
| gulp.watch('./scss/**/*', css); | |
| } | |
| gulp.task('default', watchSass); | |
| //end watch in console Ctrl + C |