Wiki articles in category FAQs

Showing 1-9 of 9 items.
Created 6 months ago by samdark.

When to use Active Record

When to use Active Record is a common question among developers, Yii and overall.

9 0
3 followers
Viewed: 13 064 times
Version: all
Category: FAQs
Created 2 years ago by darioo, updated 2 years ago by darioo.

Show raw SQL query

Here's a quick tip to dump the SQL for query.

9 0
4 followers
Viewed: 72 576 times
Version: 2.0
Category: FAQs
Created 4 years ago by Kartik V, updated 4 years ago by Kartik V.

Overcoming removal of client helpers (e.g. ajaxLink) and ClientScript in Yii 2.0

Alternatively, inline assets (JS/CSS) can be registered at runtime from within the View. For example you can clearly simulate the ajaxLink feature using a inline javascript. Its however recommended if you can merge where possible, client code (JS/CSS) into separate JS/CSS files and loaded through the AssetBundle. Note there is no more need of a CClientScript anymore:

0 2
40 followers
Viewed: 30 407 times
Version: 2.0
Category: FAQs
Created 7 years ago by dckurushin, updated 7 years ago by migajek.

Common Yii questions

Put attention of the question answer form

14 0
23 followers
Viewed: 46 846 times
Version: 1.1
Category: FAQs
Created 7 years ago by dckurushin, updated 5 years ago by Jorgee.

Understanding the view rendering flow

If we take a look at the blog demo we have 3 major parts of our view rendering. They are:

55 1
55 followers
Viewed: 215 609 times
Version: 1.1
Category: FAQs
Created 7 years ago by Steve Friedl, updated 7 years ago by Asgaroth.

Creating a parameterized LIKE query

It's common to see users wishing to make substring DB queries, using the % metacharacter used to match anything; in this FAQ we'll search the tbl_comments table from the blog tutorial hoping to find the text in $match in the content column

13 0
21 followers
Viewed: 103 678 times
Version: 1.1
Category: FAQs
Created 7 years ago by Steve Friedl, updated 5 years ago by Jorgee.

Relations: BELONGS_TO versus HAS_ONE

It's very common to see new Yii users confusing the relations HAS_ONE and BELONGS_TO, and getting it wrong means you won't get proper values back. And though we'll talk about HAS_MANY as well, we're specifically omitting the MANY_MANY relation because it's a whole different animal.

56 0
35 followers
Viewed: 140 630 times
Version: 1.1
Category: FAQs
Created 7 years ago by Steve Friedl, updated 6 years ago by Gismo.

Understanding "Safe" Validation Rules

A common source of confusion among new Yii users is how the 'safe' validator works, how it works with other validators, and why it's necessary in the first place. This article means to clear up this confusion, as well as explain the notion of Massive Assignment.

73 0
45 followers
Viewed: 140 030 times
Version: 1.1
Category: FAQs
Created 8 years ago by Steve Friedl, updated 8 years ago by Steve Friedl.

"Why do I get a 403 error when trying to use Gii?"

After enabling the Gii module in your protected/config/main.php file and then try to use it with http://example.com/index.php?r=gii, you get an error: ~~~ Error 403 You are not allowed to access this page. ~~~ This is almost certainly caused by the IP filtering mechanism that Gii uses to protect your system from outsiders - by default it allows localhost only (both IPv4 and IPv6), and r...

6 0
5 followers
Viewed: 73 794 times
Version: 1.1
Category: FAQs
Tags: config, Gii