Showing 1-9 of 9 items.

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

Created 12 years ago by Kartik V Kartik V, updated 12 years ago by Kartik V Kartik V. 2 comments

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:

1 2
41
Viewed: 49 144 times
Version: 2.0
Category: FAQs

Relations: BELONGS_TO versus HAS_ONE

Created 15 years ago by Steve Friedl Steve Friedl, updated 12 years ago by Jorgee Jorgee. 9 comments

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
Viewed: 172 544 times
Version: 1.1
Category: FAQs

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

Created 15 years ago by Steve Friedl Steve Friedl, updated 15 years ago by Steve Friedl Steve Friedl. 3 comments

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
Viewed: 93 498 times
Version: 1.1
Category: FAQs