Questions tagged [Yii] (6875)

0
answer

How to make a render view function without reload with ajax request in Yii 2?

there are vyuha news in which there is a button that hung js event that executes this js code $.ajax({ type: 'POST', data: {'sum': sum}, headers: { 'X-CSRF-Token': yii.getCsrfToken() }, url: '/news/some-news', dataType: 'json', cache: false, success: function (result) { console.log(result) }, error: function (jqX...
Rickey7 asked April 19th 20 at 12:42
0
answer

How to get from DB otsortirovyvaya viewed product brands?

Good time of day. There is a table with goods. Fields: id, name, the brand (name), number of views of product users Need a certain part of the site to display a list of brands, sorted by the sum of the number of views of products under this brand. (Most popular brands) Can't understand, how is the whole thing in the query...
santa_Sawayn asked April 19th 20 at 12:34
2
answers

How to connect to sass yii2?

I want my project to connect to the sass files, I poluchil through AppAsset: class AppAsset extends AssetBundle { public $basePath = '@webroot'; public $baseUrl = '@web'; public $css = [ 'css/site.css', 'css/style.css', 'css/owl.carousel.min.css', 'css/owl.theme.default.min.css', ]; public $sass = [ 'css/main.sass', ]; ...
abigayle asked April 19th 20 at 12:33
1
answer

Yii2 dynamically created drop down list using foreach?

Hello, I need advice... Maybe even an explanation... Guided by this article In this view _form: foreach ($tableFromTemplate as $index => $setting) { echo $form->field($setting, '[$index]id_table')->dropDownList( ArrayHelper::map($tableDesc, 'id', 'tag_table_desc') )->label(false); in the foreach in the view ...
august_Schamberger96 asked April 19th 20 at 12:28
1
answer

How to configure routing in yii2 it to be like in zend framework?

I enabled prettyUrl for controllers and actions, this is working fine as expected /controller/action and not r=controller/action. OK I have a filter where there may be a large set of parameters. but to me the engine generates all this as /movie/search?type=all&genre_id=4&quality_id=6&year=2020&rating=[8,1...
Augusta_Conr asked April 19th 20 at 12:05
2
answers

How to prevent redirect with ajax request in a modal window?

Good afternoon. The essence is this: There is a button that when clicked performs an ajax to send SMS to confirm the registration and then opens modelka with a field for entering this text. Inside moduli in addition to fields for entering the SMS submit button to confirm that submits the form. Here everything is OK. It took...
Trevion.Mertz asked April 19th 20 at 12:05
0
answer

Active record is empty relatedRecords. Why?

There are 2 models, ProduceInStore and produceHasSupplier. Which are linked. In ProduceInStore public function getProduceHasSupplier() { return $this->hasOne(ProduceHasSupplier::className(), ['code' => 'code']); } In ProduceHasSupplier public function getProduceHasSupplier() { return $this->hasOne(ProduceHasSup...
monroe_Ruecker asked April 19th 20 at 12:04
2
answers

Does it make sense to use Yii2 with Vue?

Hello, I reformulate the last question. I have a website and now it is mostly static, I need to make it sufficiently reactive, whether to use yii to return something other than the actual pages themselves, or just to use it the REST of the ability, as all it to organize?
gonzalo asked April 19th 20 at 11:55
0
answer

How to integrate Vue into the website on yii2?

Hello, is there a website purely on yii2, it gives static, but some interactivity is written in jquery. It was decided to transfer the whole thing on the vue. Now the site consists of many widgets, I will explain on the example of ribbons of posts of the user. I need to add reactivity to the website, in order to enjoy all ...
Orval_Harber asked April 19th 20 at 11:54
1
answer

How to do maintenance work on the website on/off using a catchAll?

Hey all, had a question about the implementation of the already working website. I know that in the config there is a'catchAll' => ['site/offline'], How to make order in the database just to change one field for example called site_offline 0/1 and if " 1 " in the config is a catchAll if 0 it is not present and the site w...
gerhard.Lowe85 asked April 18th 20 at 13:32