上一篇 关于 Yii CHttpSession性能优化篇之源码流程分析 有详细分析CHttpSession执行流程,在了解CHttpSession的详细执行流程之后,我们就可以非常轻松的扩展Yii Session,来优化和符合自己的业务流程。
上一篇 关于 Yii CHttpSession性能优化篇之源码流程分析 有详细分析CHttpSession执行流程,在了解CHttpSession的详细执行流程之后,我们就可以非常轻松的扩展Yii Session,来优化和符合自己的业务流程。
当我们使用Yii数据库去保存Session时,只要简单的配置就可以完成这个功能,在进行性能优化这个主题之前,我们先来查看一下CHttpSession和CDBHttpSession源代码,探讨CHttpSession和CDBHttpSession的流程再进行深一步优化主题。
Many time for SEO porpouses is important that each page will have a unique address.
This article will show you how to add links and class to each node in ctreeview. so you can attach events in js by obtaining handler on anchor or class.
MultiActiveRecord is an extension that add support for multiple database connection for your application.
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.
I used Zaccarias excellent article as the base http://www.yiiframework.com/wiki/145/cjuidialog-for-create-new-model/
First follow the wiki above to create all the required code. Then make the following modifications in your...
Well I finally had some time and tinkered a bit with the notion of integrating wordpress and Yii. Now for me I wanted to use Yii as a framework to develop wordpress plugins. Using some tips from imasia Article I was able to do a simple integration of yii as a wordpress plugin. The integratio...
What would you do if you want/need to have a different than the main database connection in an module's models?
To get null
from database instead of empty strings you need to set up your DB connection as follows:
This will syntax check each php file recursively from the current directory.
All the basic functionality for an action used by the xupload extension. Check resources for the source code of this action
在经过畅K网的实战后,总结一下在Yii的项目中会经常用到的组件和一些基本的使用方法,分享给大家,同时也给自己留个备忘录,下面我以代码加图片说明.
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.
We often need to display a success page after the user has submitted a form without problem. We may show some welcome message after a user registers a new account. There are many ways to implement this workflow. In this article, I will explain a method that exploits flash messages.
Simple as that. I have placed this action in my extension folder like:
Many applications wish to obtain parts of the URL for the current page (the hostname, the query string, etc.), and the CHttpRequest
class wraps various $_SERVER
variables to break down the URL into its constituent parts.
When using the latest stable jQuery UI themes (1.8.10) with Yii 1.1.6 (which uses 1.8.6) the widgets don't appear (they're invisible but they're there). In order to make them visible you need to change the following line:
If you are testing your app and use urlManager in your config, sometimes you will find a problem: you want to test your site independing from urlManager settings. in that way you need to extend your WebTestCase class by this method:
Most controls that are rendered by CHtml have an argument called $htmlOptions. This argument is an array that holds the attributes of the HTML element. For example the following code: