Wiki

Articles in category "tips", sorted by date (updated)X
Displaying 91-100 of 153 result(s).

Custom Archive in Blog system

Updated 4 years ago by nirmalrokaTips0 comments – viewed 5,490 times – ( +2 ) – version 1.1
Hi I had made simple archive system for blog system that can handle tbl_post. I had used simple CDbCriteria not more than that. I know there is more and many better way to this but I think this will give some idea to users to generate new idea or customized or modified this version of code.

Customize CGridView columns directly in your view

Updated 4 years ago by clapasTips4 comments – viewed 30,111 times – ( +3 / -2 ) – version 1.1
You usually take a model instance passed into your view to provide data to a CGridView in this way:

Yii behind a reverse proxy, SSL support and correct IP logging

Updated 4 years ago by mrkmgTips0 comments – viewed 5,886 times – version 1.1
If you are hosting Yii behind a reverse proxy, for example nginx, and you are having issues with your logs showing the proxies IP, or the urls being created arn't being created for SSL because your SSL certs are located on your reverse proxy instead of the Yii server, this code may be able to help you. I placed them in the very top of Yii's entry script, index.php

How to filter CGridView with From Date and To Date datepicker

Updated 4 years ago by kiran sharmaTips16 comments – viewed 45,358 times – ( +17 / -4 ) – version 1.1
This artical is related to allow user to filter CGridView with date range using datepicker on submit button. Here I use Yii Cookie to preserve date in datepicker textbox after submitting the form.

CGridView: Display the full record (actionView) in a CJuiDialog

Updated 4 years ago by JobloTips7 comments – viewed 41,615 times – ( +15 ) – version 1.1
If you show a model (with a lot of attributes) partially in a CGridView, it can be helpful when the user can take a quick look at the full record with all attributes without displaying the view as a page and afterwards returning back to the gridview.

CGridView: Update/create records in a CJuiDialog

Updated 4 years ago by JobloTips12 comments – viewed 46,321 times – ( +14 ) – version 1.1
My article Display the full record in a CJuiDialog uses ajax to view a record in dialog on clicking the 'view-icon'.

Access log output from unit tests

Updated 4 years ago by MikeTips2 comments – viewed 7,157 times – ( +4 ) – version 1.1
Say, you want to write a test for a component which provides a caching feature. How would you know, that some method of your component returns a cached result? With the solution described here you can inspect all log outputs. So you could search the logs for accesses to the DB to really make sure, that the result was served from cache.

Update two models with one view

Updated 4 years ago by SebKTips11 comments – viewed 39,068 times – ( +10 / -2 ) – version 1.1
Suppose to have two models: Users and Emails. You do not want to store email in a Users model. And User can have 0 or many emails. This is the form generated to create a new user (just username).
tags: database, model, view, form

Change buttons on our CGridView extending yii

Updated 4 years ago by sensorarioTips6 comments – viewed 27,874 times – ( +12 ) – version 1.1
In this tip, I'll help you to change in few second buttons of your CGridView. I hope you like it =).

关于Yii CHttpSession性能优化篇之源码流程分析

Updated 4 years ago by Maurizio Domba CerinTips0 comments – viewed 9,853 times – ( +1 / -1 ) – version 1.1
当我们使用Yii数据库去保存Session时,只要简单的配置就可以完成这个功能,在进行性能优化这个主题之前,我们先来查看一下CHttpSession和CDBHttpSession源代码,探讨CHttpSession和CDBHttpSession的流程再进行深一步优化主题。