Skip to content
Advertisement

Tag: yii

Securing php api to use in android application

I am newbie to android development. I am using android studio for developing an application. Things i have done Created a DB with two tables in it in MySQL. Created two separate api’s for both GET and POST methods. Successfully accessed both api’s What i have achieved for now Able to GET data form the GET api. Able to POST

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

Yii deleteAll() records with condition

I’ve set up a log in process where a verification code is generated, and when successful, is then removed. However, i want to make sure that if there’s multiple verification codes for the same user, …

Yii – findAll with order by

How to findAll with specific column with order by desc ? Code bellow worked and find all from the developer id $id = Yii::app()->user->getState(‘id’); $models = Games::model()->findAll(‘…

SQL Query to join multiple tables

I have 4 tables that I need to connect in order to get the reports that I need. But I’m confused on how to write the query. Below are the sample of the tables: Client Table Consultant Perm Temp The end result of the report that I want to show is something like this: I’m trying to use the LEFT

Turning YII_CSRF_TOKEN secure flag on

I have enabled CSRF Validation in Yii: ‘enableCsrfValidation’ => true, Everything works as expected however I’d like for the session cookie to have the secure flag turned on. With other cookies you can set the secure flag in the config: How do you do this for the YII_CSRF_TOKEN? Answer You can’t do that with the built in CHttpRequest component. You

How to change the database connection in YII

I have yii application,, and i want to change the database connection.. first, my app is connect to ‘trackstar’ database, and later i want to change to ‘taskmanagement’ database.. So i just simply change the dbname in my code : but when i run the app i got error : CDbCommand failed to execute the SQL statement: SQLSTATE[42S02]: Base table

Yii hasAttribute and Custom Fields

How can I use hasAttribute with Custom Fields? Code: EXAMPLE Model.php Code: Answer You should simply use : https://www.php.net/manual/en/function.property-exists.php hasAttribute will only check for db attributes.

Advertisement