Wiki articles

Showing 101-120 of 799 items.

Use CGridview to sort and filter CSqlDataProvider - when used with UNRELATED tables (or complex queries)

Created 4 years ago by Gerhard Liebenberg, updated 4 years ago by Gerhard Liebenberg.

I have two tables called hospitals and departments. I have a junction table between them which holds the departments in each hospital. But sometimes I need a list of "All hospitals with All possible departments" - regardless of whether they are linked in the junction table or not.

0 0
3 followers
Viewed: 21 731 times
Version: 1.1
Category: How-tos

Define general array and variable and call it to anywhere in application

Created 6 years ago by bhavesh vaghela, updated 6 years ago by Maurizio Domba Cerin.

Create param.php file in protected/config

Yii::app()->params['TEXT_ACTIVE'] = 'Active'; //1 for active

1 4
3 followers
Viewed: 11 105 times
Version: 1.1
Category: Tutorials
Tags:

Managing a star rating with the StarRating widget in Yii 2

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

In Yii 1.x, there was a built in widget CStarRating based on the jquery star rating plugin. There exists no prebuilt solution in Yii2, however the same concepts can be extended using any jquery plugin.

1 3
41 followers
Viewed: 16 389 times
Version: 2.0
Category: How-tos
1 3
3 followers
Viewed: 7 111 times
Version: 1.1
Category: How-tos

Displaying uploaded file from DB for update with FileInput widget

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

This is for folks who are using \kartik\widgets\FileInput to upload files from your client. How do you display an image for update after you have uploaded it to the server using the widget?

1 3
42 followers
Viewed: 46 775 times
Version: 2.0
Category: How-tos

Simple Web APIs for your Yii App

Created 5 years ago by shiv, updated 5 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: 24 695 times
Version: 1.1
Category: How-tos
Tags: API, JSON

Extending CJuiDialog

Created 7 years ago by dstudio, updated 7 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: 14 125 times
Version: 1.1
Category: How-tos

Login Form With email or Whatever

Created 5 years ago by nabil abdouali, updated 5 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: 23 030 times
Version: 1.1
Category: How-tos

CPhpAuthManager - how it works, and when to use it

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

It is actually mentioned in the documentation

1 2
6 followers
Viewed: 26 699 times
Version: 1.1
Category: How-tos

Yii 1.1.17 Ubuntu AutoInstall Bash Script

Created 3 years ago by Preacher, updated 3 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: 8 900 times
Version: 1.1
Category: Others

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

Created 8 years ago by Davidhhuan, updated 8 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: 9 674 times
Version: 1.1
Category: Tutorials

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

Created 6 years ago by Alexander Palamarchuk, updated 6 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: 11 043 times
Version: 1.1
Category: Tips
Tags: config

Setting static modules' properties in config

Created 6 years ago by Alexander Palamarchuk, updated 6 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: 11 284 times
Version: 1.1
Category: Tips
Tags: config, module

An easy way to use escopes and CActiveDataProvider

Created 8 years ago by Rafael Garcia, updated 8 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: 33 069 times
Version: 1.1
Category: Tips

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

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

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

1 1
3 followers
Viewed: 17 441 times
Version: 1.1
Category: Tips

Create URL to language switcher anchor with langhandler

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

This topic is related with langhandler extension

1 1
2 followers
Viewed: 7 386 times
Version: 1.1
Category: Tips

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

Created 8 years ago by dinhtrung, updated 8 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: 16 356 times
Version: 1.1
Category: Tips

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

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

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

1 1
1 follower
Viewed: 11 735 times
Version: 1.1
Category: Tips

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

Created 5 years ago by Ankit Modi, updated 6 months 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: 40 187 times
Version: 1.1
Category: Tutorials

Add model validator in Controller

Created 4 years ago by Kostas Apazidis (KonApaz), updated 4 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: 22 314 times
Version: 1.1
Category: Tips