Yii answers

  • 3answers
    Displaying an avatar using one method, how to do it in OOP?
    Just learning oop and Yii2. I want to display the user's avatar using a simple method, but I need to check if there is an avatar in the database, if there is a file in the folder. And I just need to write in one place & lt;? = \ Modules \ user \ Module :: getAvatar ($ model- & gt; user- & gt; ...
    Yii Dominic Kramer, Mar 11, 2019

  • 1answers
    Mina, did anyone set up a site deployment on Yii2?
    Hello everyone! In general, the problem is as follows: Actually there is a site on Yii2 (Yii 2 Advanced template), working on nginx. To deploy the application from the test server to the product, I used mina. The deployment is successful, there are no errors, and the required structure is created. ...
    Yii Gabriella Vazquez, Sep 20, 2020

  • 2answers
    Why does debug panel die in yii2?
    On a certain page of the site, the debug panel displays (this code pops up in the panel itself, instead of it): PHP Fatal Error 'yii\base\ErrorException' with message 'Call to a member function formName() on null' in L:\domains\newtm\yii\vendor\yiisoft\yii2\helpers\BaseHtml.php:1882Stack ...
    Yii Audrey Blackburn, Jul 31, 2020

  • 1answers
    How to do grouping of Redis cache keys in Yii 1.1?
    There is a task, when updating data, to clear the cache, but not all but of certain groups. classes https://github.com/phpredis/phpredis < br /> https://github.com/phpnode/YiiRedis do not provide the ability to delete by mask you can find keys by mask, but you cannot delete this ...
    Yii Evangeline Calderon, Jul 17, 2019

  • 3answers
    How can I change the Yii 2 basic theme to Admin LTE?
    How to change Yii2 Basic theme to Admin LTE Not working for me please help. thanks for your reply
    Yii Anonymous, Apr 12, 2019

  • 1answers
    How to do this kind of validation in Yii2?
    Good afternoon. Yii2 has an Exist validator that checks that if there is no such record, throw an error. Tell me, please, but how to check the other way around in the model, what if there is such a record - display an error?
    Yii Anonymous, May 27, 2019

  • 2answers
    Yii2 Need to integrate widget into GridView StarRating?
    There is a need to insert a StarRating widget into the GridView widget, how to do it? GridView::widget([ 'dataProvider' =&gt; $dataProvider, 'filterModel' =&gt; $searchModel, 'responsiveWrap' =&gt; false, 'columns' =&gt; [ ['class' =&gt; ...
    Yii Vivian Kemp, May 29, 2019

  • 0answers
    How to make a semi-transparent watermark using the CImageHandler library in yii1?
    Good afternoon, When loading an image, I overlay a translucent png watermark on it, but for some reason - the entire transparent background becomes a white rectangle, // в поведении загрузки изораженияpublic function createWM($image) { Yii::app()-&gt;ih ...
    Yii Anonymous, Aug 31, 2019

  • 2answers
    How do I correctly make a select using hasMany ()?
    Good afternoon, Organized a connection in the database and generated hasMany () in the model class Day extends \yii\db\ActiveRecord{public function getXxx() { return $this-&gt;hasMany(\app\models\xxx::className(), ['days_id' =&gt; 'id']); } How can I get a connected array in ...
    Yii Naomi Valenzuela, Aug 9, 2019

  • 2answers
    How to set script when updating model in yii2?
    Everything is simple when creating: new MyModel ([&#39;scenario&#39; = & gt; &#39;register&#39;]); And when updating how? $model = MyModel::findOne($pk);......if($model-&gt;validate()) {     $model-&gt;update();}
    Yii Anonymous, May 5, 2019

  • 1answers
    How do I force CDbCriteria to do distinct query on one field instead of all?
    Good evening. I pull in data through Active Record and use the CDBCriteria object as an object with conditions. $criteria = new CDbCriteria();$criteria-&gt;distinct = true;$criteria-&gt;select = 'id, alias, title';$criteria-&gt;condition = "urlrouting_show &lt;&gt; 0";$criteria-&gt;order = ...
    Yii Anonymous, Jan 29, 2020

  • 4answers
    How to write an authentication service correctly?
    Good day. The task was to implement an authentication service, in fact the system is an exact copy of the system that is used for authentication by Thematic Media projects, ie. here, on habr, megamind, etc. Question one: Yii2 or Laravel? In this case, it is better on where it will turn out ...
    Yii Audrey Cervantes, Apr 10, 2020

  • 2answers
    How do I execute save () without validation?
    Hello, I have validation rules set - but when adding additional fields. It works and prevents me from adding more empty inputs to the form - how can I do $ model- & gt; save () without validation?
    Yii Clara Eaton, Jul 7, 2020

  • 1answers
    How to render a view when adding a field ajax?
    Good afternoon, my form &lt;?php $form = ActiveForm::begin([ 'enableClientValidation' =&gt; true, 'options' =&gt; [ 'enctype' =&gt; 'multipart/form-data', ], ]); ?&gt; my ...
    Yii Gabriella Gibbs, Mar 30, 2020

  • 1answers
    Setting up nginx, why is the request not being passed to php-fpm?
    Good day! There is such a config: server { charset utf-8; client_max_body_size 128M; listen 80; ## listen for ipv4 server_name tes.lc; root /path/web; index index.php; location / { try_files $uri $uri/ ...
    Yii Anonymous, May 16, 2020

  • 4answers
    How to view and analyze Yii2 / Nginx error logs?
    Good afternoon, colleagues. I wanted to know what tools you use for convenient viewing and analysis of application error logs on Yii2, and separately nginx. Thank you!
    Yii Isla Hebert, Oct 11, 2019

  • 0answers
    How to connect two domains in .env in yii2?
    Downloaded the yii-strater-kit project the domain is registered there in .env FRONTEND_URL = localhost / yii2-starter-kit How to connect two domains? because when you click on the main page or even redirect only to this domain.
    Yii Anonymous, Jun 17, 2020

  • 1answers
    Yii2 Are there any tools to automatically connect resources?
    I remember for the first version on habra there was habrahabr.ru/post/150885 Who else have met what options? I would like to read and not write a bike.
    Yii Aria Miller, Oct 8, 2019

  • 5answers
    Speed ​​or Best Practices?
    Not so long ago I started programming. Having studied the basics of php, I took up the yii2 framework, while reading the best programming practices. I faced such a problem that if you follow all the best practices (SOLID, TDD, DDD, etc.), the application will be much slower to develop, and less ...
    Yii Anonymous, Oct 7, 2019

  • 2answers
    Where and how to re-initialize fancybox on ajax loading?
    After loading with ajax, fancybox stops working on photos. It turns out that you need to re-initialize fancybox. Where can I do this in php? I would not want to go into js
    Yii Anonymous, Jun 22, 2020