I want to get the parent username of a user The ‘parent.username’ works this way: But I need url the user profile, and I have it like this It is possible to get the username? Thank you Answer In the User class: In the gridView:
Tag: yii2
Users’ timezone issue onYii2 with PostgreSQL
I would like to ask for a better approach. I am using Yii2 with PostgreSQL, and set all timestamp fields for all table to timestamp with timezone data type. timestamp with time zone NOT NULL DEFAULT …
Yi2 Download File Using SendFile()
I am attempting to use the built in function sendFile() provided by Yii2 to allow users to download files. This will not, however, actually download the file. Below is my ajax code $.ajax({ …
yii2 double gridview in a form
I have 2 gridview in a form and from them I have to extract selectedrows, which I did with ‘class’ => ‘kartikgridCheckboxColumn’. In a controller receive the selected values in a selection[] variable. Here comes the problem. The selection[] variable brings the selection of the 2 gridViews. Ex: array (size=2) 0 => string ’10’ (length=2) 1 => string ’44’ (length=2)
The Content-Type HTTP header is missing charset attribute
During security check, its reported that “The Content-Type HTTP header is missing charset attribute” is missing for js and css file. Please check below screenshot: My HTML Was look like below before …
Yii2 Migration move data to other table
I have table: and I have created table I want to move some data(date_used & used_by_user_id) from table ticket to other table used with migration yii2 in the query. But I don’t know how to do it without ActiveRecord & array. Answer Only sql. Yii-migration not supported select in the insert into
Kartik export menu showing incompatible error message
I’m using kartik export menu and it’s showing the error below. PHP Strict Warning – yiibaseErrorException kartikgridGridView and kartikbaseBootstrapTrait define the same property ($bsVersion) in the composition of kartikgridGridView. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed Code: What can be the cause of this since i’ve followed the kartik instructions
Yii2 ArrayDataProvider does not show already paginated data
I have an issue with ArrayDataProvider object that Yii2 provides. I have a huge API call that returns more than 7k items (this is a problem because obtaining all items takes a long time). I realized that I can tell the API to paginate for me so I was trying to implement the already paginated data into an ArrayDataProvider but
Yii2 kartik/date/datepicker shows wrong format while update
I use kartik DatePicker in my activeform. My activeform field: While creating I save it as a UTC date format : When I update, it shows as I need this as Answer You have to provide the formatted date to the widget. When using ActiveForm you can override afterFind() for the specific model to format the date and override the
Yii2: How to redirect to with UrlManager?
In my Yii2 config I have: If I go to site.com/search it works. If I go to site.com/site/index it also works and shows the same content. How to redirect the call instead of just showing the response of site/index? It must also redirect with params (site.com/site/index?param=1 -> site.com/search?param=1) Answer The UrlManager does not redirect. It rather does a rewrite like