Questions tagged [yii2]

Yii 2 is the latest version of the Yii framework - a high-performance, component-based PHP framework

Yii Framework

Yii is a generic Web programming framework, meaning that it can be used for developing all kinds of Web applications using PHP. Because of its component-based architecture and sophisticated caching support, it is especially suitable for developing large-scale applications such as portals, forums, content management systems (CMS), e-commerce projects, RESTful Web services, and so on.

Yii 2.0 is the current version of the Yii PHP framework, released on October 12, 2014. The latest version can be downloaded from the Yii website. Guidelines on how to upgrade minor Yii 2.0 version and changelog can be found here.

Yii 2.0 is a complete rewrite of Yii 1.1 based on PHP 5.4 improvements and aims for simplicity, performance and extensibility. The framework adopts namespaces and traits, PSR standards, , and . Yii 2.0 implements the dependency injection container and service locator. It makes the applications built with Yii more customizable and testable.

Official documentation can be found in the Definitive Guide to Yii 2.0. Further important documentation sources:

More information on the current project status can be found in the Yii 2.0 release announcement and the project roadmap.

15456 questions
3
votes
1 answer

YII 2, Method Not Allowed (#405)

When i delete a Record in GridView i got this Error on my Hosting Server. Local its working without Problems. What i dont understand is: The error says -> Method Not Allowed. This url can only handle the following request methods: POST. When i…
3
votes
1 answer

How to truncate text in a specific Yii2 GridView column and show it on hover?

I render a table using the GridView widget: $dataProvider, 'filterModel' => $searchModel, 'columns' => [ 'subject', // ... ], ]) ?> I need to truncate the text displayed in…
Adam Vtípil
  • 80
  • 1
  • 6
3
votes
1 answer

Yii 2 Update All Not IN

Based on the code below, I want to update all in customer to status 1 where status = 2. However, i want to run the code below where customer_id not in (1, 3, 5, 8). $customerNotIn = array(1, 3, 5 ,8); Customer::updateAll(['status' => 1], 'status =…
CloudSeph
  • 863
  • 4
  • 15
  • 36
3
votes
3 answers

how to run custom code after every $model->save() function in yii2

I want to execute my custom code after or before every $model->save() in Yii2. I want to perform this globally like using components, etc. I want to create a user activity log to store how many times a user insert or update any rows in database…
Fahad Ali
  • 114
  • 1
  • 14
3
votes
1 answer

SwiftMailer attach image in email body

Basically I use Yii2 mailer, But in principe, it use Swifmailer. So, I want to display an image in body email. Our user that use Mozilla thunderbird is no problem. But , in my user which is use email client based Microsoft such as OE, Ms. OE 2007,…
Fadly Dzil
  • 2,154
  • 3
  • 34
  • 85
3
votes
1 answer

How to name model rule on Yii2?

I just started learning Yii2 and I have a problem here. I want to set new rule on name field, which would replace all first letters to the uppercase, but I don't know how to set the rule name and I'm constantly getting error messages of it. Now my…
devorye
  • 193
  • 2
  • 16
3
votes
1 answer

synchronous ajax error with yii2 activeform

The below view is rendered by ajax and returned from controller to JS which puts view inside correct container : $page = $this->renderAjax("view", [ "dataProvider" => $dataProvider ]) ; …
fortm
  • 4,066
  • 5
  • 49
  • 79
3
votes
2 answers

Yii2 frontend\runtime\debug\mail folder gets very heavy! Can I stop this logging?

Yii2 is logging each and every mail I send as .eml file and stores into frontend\runtime\debug\mail. This folders gets very heavy and eats up all my server space. Is there anyway to stop it. I am using swift mailer. 'mailer' => [ 'class' =>…
sphinx
  • 717
  • 1
  • 7
  • 19
3
votes
1 answer

Set up a worker in Yii2-Heroku

I have a controller action for accepting the bulk user data, process data and then present the result. Since it is a tedious process, I am trying to assign the same to a worker and later present the results. I need help with setting up the worker…
Dency G B
  • 8,096
  • 9
  • 47
  • 78
3
votes
3 answers

Yii Framework get user data

How can I get currently online user data with all the parameters from the database? Right now I get it's ID by using this: echo Yii::$app->user->getId(); Can I reach other data somehow or do I have to create a function which gets all the…
The50
  • 1,096
  • 2
  • 23
  • 47
3
votes
1 answer

How to install a project from github based on yii

I'm a newbie studying how it works YII. I found this project interesting. Yii2-simple-classified with app-advanced https://github.com/deviardn/diadoo I read the documentation but I do not know exactly what I should do to be able to test it on…
3
votes
2 answers

How to have class loaded without using "use" but call it as if I used it

I have studied these 2 sources, but none of those works for me. http://www.yiiframework.com/doc-2.0/guide-concept-autoloading.html Yii2 - How do I AutoLoad a custom class? I have created custom helper class which I want to include in every model,…
Ripper
  • 1,132
  • 13
  • 26
3
votes
1 answer

How to change sorter param in Yii2 / GridView?I

I have two tables with farily same names of the columns, usinng two different search models (both using ActiveDataProvider's) so when I sort one by a column, the other gets affected as well. I have tried setting this in my second GridView: 'sorter'…
Zlatan Omerović
  • 3,863
  • 4
  • 39
  • 67
3
votes
1 answer

Yii2 GridView SqlDataprovider sort not working

I have the following query: $query = (new \yii\db\Query()) ->select([ 'p.id', 'p.name', 'c.name AS contact_name', 'l.name AS laboratory', 'p.status', …
user3021615
  • 33
  • 1
  • 8
3
votes
0 answers

How to Integrate AngularJs in Yii2

I want to use angularjs in my yii2 application. My questions are. 1) Is angularjs fixiable with yii2 2) Which one will the best choice to use routing Angular OR Yii2 Please tell some advantages or disadvantages of angularJs with Yii2.Thanks for…
Dani
  • 905
  • 7
  • 14
1 2 3
99
100