Wiki articles

Showing 101-120 of 823 items.

Simple Web APIs for your Yii App

Created 11 years ago by shiv, updated 11 years ago by CeBe.

Its very common now-a-days to have Mobile app for web apps. For Mobile apps we need web APIs to fetch data or even post/update on web. We found a very simple method to make such interface. Mobile App can call plain get or post request and receive data back in JSON format. JSON is relatively easy for mobile app to handle while plain standard GET/POST request for easy for Web server to handle. This...

1 2
10 followers
Viewed: 34 799 times
Version: 1.1
Category: How-tos
Tags: API, JSON

Extending CJuiDialog

Created 12 years ago by dstudio, updated 12 years ago by Maurizio Domba Cerin.

Sometimes you have CJuiDialog with different content but same buttons (or width, height). If you don't want to repeat yourself this is a great solution:

1 2
2 followers
Viewed: 19 366 times
Version: 1.1
Category: How-tos

Login Form With email or Whatever

Created 11 years ago by nabil abdouali, updated 11 years ago by nabil abdouali.

Here is my solution to login with email or anything else This update works with database mysql You must generate the user model with GII

1 2
2 followers
Viewed: 33 323 times
Version: 1.1
Category: How-tos

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

Created 11 years ago by Kartik V, updated 11 years ago by Kartik V.

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 followers
Viewed: 45 925 times
Version: 2.0
Category: FAQs

CPhpAuthManager - how it works, and when to use it

Created 13 years ago by dckurushin, updated 13 years ago by François Gannaz.

It is actually mentioned in the documentation

1 2
6 followers
Viewed: 33 904 times
Version: 1.1
Category: How-tos

Yii 1.1.17 Ubuntu AutoInstall Bash Script

Created 9 years ago by Preacher, updated 9 years ago by Preacher.

Just thought I would share this bash script I wrote to help automate a base install of YII on an Ubuntu server. This script does the following:

1 1
1 follower
Viewed: 12 536 times
Version: 1.1
Category: Others

embed a view file of the class which implement the CAction.

Created 14 years ago by Davidhhuan, updated 14 years ago by Davidhhuan.

In Yii, we can define an action class and ask the controller to instantiate it. And we always create ourselves actions class in rootPath/protected/extensions, and the view file we called in the actions class always are located in rootPath/protected/views/ControllerNAME or rootPath/themes/ThemeNAME/ControllerNAME, then when we use the same actions class in different controllers, we have to copy it...

1 1
2 followers
Viewed: 27 457 times
Version: 1.1
Category: Tutorials

Making friends' configs, DB credentials and paths with version control

Created 12 years ago by Alexander Palamarchuk, updated 12 years ago by ajsharma.

In many cases developers of one project use their own local environments for coding. There may be a common test platform and, of course, production. All these environments usually have different DB credentials and directory structures (first of all, path to YII framework directory). Another feature is debugging. It's convenient to turn it on for local environments, eventually - on the test s...

1 1
4 followers
Viewed: 18 973 times
Version: 1.1
Category: Tips
Tags: config

Setting static modules' properties in config

Created 12 years ago by Alexander Palamarchuk, updated 12 years ago by Alexander Palamarchuk.

You may face a situation when you need to access to a configurable module's property from everywhere and you don't have an instance of this module's class.

1 1
2 followers
Viewed: 15 038 times
Version: 1.1
Category: Tips
Tags: config, module

An easy way to use escopes and CActiveDataProvider

Created 14 years ago by Rafael Garcia, updated 14 years ago by Rafael Garcia.

Often used scopes to define criteria in our models. This is a very useful feature as it ensures that in any part of application applying the criteria defined by the scope when called it.

1 1
10 followers
Viewed: 38 285 times
Version: 1.1
Category: Tips

Speedup unit tests by moving MySql data to memory (in Ubuntu)

Created 12 years ago by seb, updated 12 years ago by François Gannaz.

There are several ways to speedup slow unit tests which interact with database:

1 1
3 followers
Viewed: 24 008 times
Version: 1.1
Category: Tips

Create URL to language switcher anchor with langhandler

Created 11 years ago by Anas AbuDayah, updated 11 years ago by Anas AbuDayah.

This topic is related with langhandler extension

1 1
2 followers
Viewed: 11 944 times
Version: 1.1
Category: Tips

Using MBMenu and Rights to automatically create menu item for your modules

Created 14 years ago by dinhtrung, updated 14 years ago by dinhtrung.

Using Rights generator component, we can easily create a dynamic menu, in which we scan every modules' controllers, to access the index page of them.

1 1
2 followers
Viewed: 18 716 times
Version: 1.1
Category: Tips

Yii CDBHttpSession数据库存储session性能优化实战

Created 13 years ago by Darwin Wen, updated 13 years ago by Darwin Wen.

上一篇 关于 Yii CHttpSession性能优化篇之源码流程分析 有详细分析CHttpSession执行流程,在了解CHttpSession的详细执行流程之后,我们就可以非常轻松的扩展Yii Session,来优化和符合自己的业务流程。

1 1
1 follower
Viewed: 14 786 times
Version: 1.1
Category: Tips

How to display Dependent drop-down value using ajax call with dynamically

Created 10 years ago by Ankit Modi, updated 6 years ago by samdark.

Hi Friends, In this tutorial I write a code display dependent drop-down value using ajax call.

1 1
6 followers
Viewed: 51 659 times
Version: 1.1
Category: Tutorials

Add model validator in Controller

Created 10 years ago by Kostas Apazidis (KonApaz), updated 10 years ago by Kostas Apazidis (KonApaz).

There are cases that model validators should be depended by controller/action and you couldn't manipulate on the model class or using scenarios in easy way

1 1
3 followers
Viewed: 33 114 times
Version: 1.1
Category: Tips

Simple access control

Created 13 years ago by szfjozsef, updated 13 years ago by szfjozsef.

For those who feel, the Controller->accessRules() or RBAC (Role-Based Access Control) is too complicated or doesn't want the username(s) to be hard-coded in accessRules(), here is a very simple, easy-to-implement solution.

3 7
10 followers
Viewed: 47 412 times
Version: 1.1
Category: Tutorials

How to store array/widget configuration to the database with config validation rules

Created 11 years ago by Kartik V, updated 11 years ago by Kartik V.

Note the tag {{homeUrl}} will be dynamically replaced at runtime.

2 3
41 followers
Viewed: 26 165 times
Version: 2.0
Category: Tutorials

Install specific Yii2 vendor extension & dependency without updating other packages.

Created 11 years ago by Kartik V, updated 11 years ago by Kartik V.

The tips here are for advanced usages of composer and its assumed you have read about using composer and have a knowledge of your vendor packages to be updated. Let's consider, you want to update only one specific yii2 vendor library, without updating all the other extension packages?

2 3
39 followers
Viewed: 45 988 times
Version: 2.0
Category: Tips

Managing your nested dropdown dependency with DepDrop widget

Created 11 years ago by Kartik V, updated 11 years ago by Kartik V.

If you are coming over to Yii 2 from Yii 1.x, you may have already read this useful wiki for creating dependent dropdowns. You can use a similar approach in Yii 2 to do the same. But if you are looking at a prebuilt solution that helps you manage it easier, read along.

2 3
42 followers
Viewed: 90 575 times
Version: 2.0
Category: Tutorials