[Solved] Yii2 $_GET parameter in URL

[ad_1] Inside your config, where you declare your components, add or modify the urlManager like this: ‘urlManager’ => [ ‘enablePrettyUrl’ => true, ‘showScriptName’ => false, ‘enableStrictParsing’ => false, ‘rules’ => [ ‘projects/<url>’ => ‘projects/ACTION’, ], ], In order for this to work, first, the path projects/action has to match your controller action, and then projects/<url> … Read more

[Solved] Angularjs :- how to get funtion’s response using $http.get()?

[ad_1] In cust.php you actually need to call the function as well <?php header(‘Content-Type: application/json’); function testdata(){ $str=”{“employees”:[{“firstName”:”John”, “lastName”:”Doe”},{“firstName”:”Anna”, “lastName”:”Smith”},{“firstName”:”Peter”, “lastName”:”Jones”}]}”; return $str; } echo testdata(); ?> EDIT: I’ve had to change your $str as well, single quote surrounding keys and values are not valid, I have changed it to double quotes ” which are … Read more

[Solved] Repost/ asking again. Change event in Kartik’s bootstrap-slider extension for Yii2

[ad_1] You should always keep your console or developer bar open when working with javascript, you never know when something conflicts with the other. You need to use parseInt() to pass a value to the setValue function of the slider, it is interpreting it as text, otherwise, it throws Uncaught Error: Invalid input value ‘1’ … Read more

[Solved] Yii2 GridView filter date by year

[ad_1] Maybe you are looking for something like this: add in to your model public static function getYearsList() { $years = (new Query())->select(‘DISTINCT YEAR(`birthday`) as years’)->from(‘{{%yourTable}}’)->column(); return array_combine($years, $years); } and then in gridview [ ‘attribute’ => ‘birthday’, ‘filter’ => YourModel::getYearsList(), ] And then in your search model add andFilterWhere() to compare birthday with year. … Read more