Tag: yii

52 votes
7 answers
2.8K views
How to return just file name using glob() in php

How can I just return the file name. $image is printing absolute path name? <?php $directory = Yii::getPat

avatar
Robt
0 1 0 9
asked 07 September, 2021
55 votes
2 answers
2.6K views
What is the difference between component, extension & module in Yii

I am new to Yii framework, and just came across module, extension & component inside protected folder. Ca

avatar
Emilia
0 1 0 9
asked 07 September, 2021
51 votes
4 answers
1.6K views
Why use CJSON encode when we have json_encode

I am building an API for a website using Yii. I know that there is a utility class called CJson and has a func

avatar
Wilfredo
0 1 0 9
asked 07 September, 2021
56 votes
2 answers
1.3K views
Yii2: Why is the auth key in class User?

As the title clarifies why is the auth key introduced in Yii2? What're it's main usages and how it i

avatar
Adolfo
0 1 0 9
asked 07 September, 2021
64 votes
4 answers
3K views
how to pass parameter on redirect in yii

I am using Yii framework for my project; I am redirecting page after success of insertion in database to a

avatar
Luis
0 1 0 9
asked 07 September, 2021
58 votes
14 answers
2.8K views
Yii model to array?

How can I convert the result of Trips::model()->findAll() to an array?

avatar
Adolfo
0 1 0 9
asked 07 September, 2021
49 votes
8 answers
2.1K views
Get current controller and action id in Yii

I want to force all users to log in before accessing pages of my site. I have followed Larry Ullman's tut

avatar
Ali
0 1 0 9
asked 07 September, 2021
55 votes
2 answers
1.1K views
addColumn yii migration position

I want to add a column at the seventh place in the table, I am using $this->addColumn('table_name&ap

avatar
Royal
0 1 0 9
asked 07 September, 2021
59 votes
6 answers
1.3K views
Postgres error: null value in column "id" - during insert operation

I use postgresql and yii2 framework. Well I got a very interesting error message: SQLSTATE[23502]: Not null v

avatar
Charis
0 1 0 9
asked 07 September, 2021
61 votes
3 answers
1.9K views
What is the difference between $with and $joinWith in Yii2 and when to use them?

In the API documentation it is specified that $joinWith - A list of relations that this query should be j

avatar
Roger
0 1 0 9
asked 07 September, 2021
62 votes
8 answers
2.2K views
yii: how to make a unique rule for two attributes

I have a table like this: (id, name, version, text). (name, version) is unique key, how can i make a rule to v

avatar
Robyn
0 1 0 9
asked 07 September, 2021
56 votes
7 answers
1.6K views
Hide label for input field

I am trying to hide the label for a specific field in _form.php without success. I have tried couple of varia

avatar
Royal
0 1 0 9
asked 07 September, 2021
54 votes
4 answers
1.2K views
Yii2 : Active Record add Not In condition

What is the active Record way of adding IN condition to an active Query in yii 1.x you could use CDbCriteria l

avatar
Sachiko
0 1 0 9
asked 07 September, 2021
60 votes
9 answers
547 views
How to set the default controller in yii2

I have UserControler and I run it in virtual server http://basic.com/index.php?r=user/index. How can I set up

avatar
Ali
0 1 0 9
asked 07 September, 2021
54 votes
6 answers
1K views
Where can i find the yii version of my yii app?

I recently started to work with yii, where can i find the yii version of my yii app?

avatar
Janella
0 1 0 9
asked 07 September, 2021
66 votes
10 answers
2.9K views
Getting base URL in Yii 2

I am trying to get the base URL for the project in Yii 2 but it doesn't seem to work. According to this p

avatar
Jesenia
0 1 0 9
asked 07 September, 2021
51 votes
6 answers
1.9K views
How to use the swiftMailer in Yii2

I can't finally understand how to use the swiftMailer extension in Yii2. Judging by that on this subject

avatar
Nereida
0 1 0 9
asked 07 September, 2021
54 votes
4 answers
1.4K views
"Invalid parameter number: parameter was not defined" Inserting data

I've been using Yii's active record pattern for a while. Now, my project needs to access a differen

avatar
Denese
0 1 0 9
asked 07 September, 2021
59 votes
6 answers
442 views
Jquery - Uncaught TypeError: Cannot use &apos;in&apos; operator to search for &apos;324&apos; in

I'm trying to send a Get request by ajax and output json data that is returned by server in html. But, I

avatar
Juliane
0 1 0 9
asked 07 September, 2021
62 votes
16 answers
1.5K views
Get current URL/URI without some of $_GET variables

How, in Yii, to get the current page's URL. For example: http://www.yoursite.com/your_yii_application/?l

avatar
Robyn
0 1 0 9
asked 07 September, 2021