This the relevant code in my form: ‘dynamic-form’ , ‘layout’ => ‘horizontal’ , ‘enableClientValidation’ => true , ‘enableAjaxValidation’ => …
Tag: yii2
yii2 extract messages to db
I’m using trntv/Yii2-starter-kit. How can I extract messages to DB? My config: ‘*’=> [ ‘class’ => ‘yiii18nDbMessageSource’, ‘sourceMessageTable’=>'{{%i18n_source_message}}’, ‘…
Set reason for thrown bad request in Yii 2
I’m writing an API and I have to throw HTTP 400 bad request like below and it works fine meaning that it displays the default HTTP 400 page (I have no views defined because I’m building an API) What I would like to achieve is to give some reason for the bad request error thrown so that who is using
Yii2 Migration error – Unknown command: migratecreate Did you mean “migrate/create”?
I am learning database migration in Yii2. I am trying to create a new migration class create_news_table using command through composer. I installed composer globally and running command yii migrate/…
Getting unknown property Exception in yii2
here I have a model in yii2 when I want to submit the form I face with this error. Getting unknown property: appmodelsCarAd::used_value but as you see I have this field in my fields. My table name is car_ad. what is the problem with my code? Answer Because this field is not present in the @property comment I guess you
Is it possible to use n or in Yii2 Kartik GridView DataColumn title?
I have a table with many colomns. It has a big lable strings and smal data strings, like ‘Average usage time’ and ’55’, | Average usage time | ______________________ | 55| so i want …
Yii : How to add datepicker in order to filter gridview
Here is my codes in order to show some relation tables data in the controller and it is view code I want to add a date picker to view and use it in order to filter GridView I am new in yii2 please advise me Answer first of all install any datepicker widget i.e 2amigos date picker in your index
Yii2 validation with XRegExp, p{L} not working
I’m using Yii2 framework and I have a Validator that should do client-side validation. I have a regex that looks like this: /^[\p{L}]+$/u for simplicity, but my actual regex is a bit more complicated,…
Yii2 CORS with Auth not working for non CRUD actions
I am building an API in Yii2 and have added CORS and authentication. This works fine for all Create/Read/Update/Delete actions but not for custom actions. Has anyone experienced this before? URL …
Yii: How to add inline style to select option item?
I have select HTML tag generated by this code: I would need to add an HTML attribute (e.g. inline style) to each option tag. Can you give me a hint, please? Answer You can use options