In this wiki I will show how to create own custom global function. It may be save the space and reduce the time.
In this wiki I will show how to create own custom global function. It may be save the space and reduce the time.
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...
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:
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
It is actually mentioned in the documentation
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:
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...
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...
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.
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.
There are several ways to speedup slow unit tests which interact with database:
This topic is related with langhandler extension
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.
上一篇 关于 Yii CHttpSession性能优化篇之源码流程分析 有详细分析CHttpSession执行流程,在了解CHttpSession的详细执行流程之后,我们就可以非常轻松的扩展Yii Session,来优化和符合自己的业务流程。
Hi Friends, In this tutorial I write a code display dependent drop-down value using ajax call.
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
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.
在经过畅K网的实战后,总结一下在Yii的项目中会经常用到的组件和一些基本的使用方法,分享给大家,同时也给自己留个备忘录,下面我以代码加图片说明.
protected $_viewFile
This behavior will automatically set timestamp fields to the row creation and modification times.