In some cases, we have to limit the number of page views for the guests users. Yii provide an efficient method to get this.
In some cases, we have to limit the number of page views for the guests users. Yii provide an efficient method to get this.
by: Christian Salazar (bluyell, @salazachris74, christiansalazarh@gmail.com)
In doing internet searches trying to learn how to incorporated ajax into web pages generated by the yii framework I noticed that there seems to be a lot of confusion. I worry that too-clever hacks will be broken in upgrades of the framework.
To replace the application component 'format', which is registered by CApplication by default, you can put this in your application 'components' config:
If you use yiic to generate webApplication there will be a layout folder under the protected/views/, and the Controller class under protected/components which will use by default these layouts files.
Hello, this article will describe some aspects about caching controllers with filters() method in your controller. And I will describe some problems I meet when using this approach for caching, the main problem was
Taking futher the idea from Piotr Masełkowski - http://www.yiiframework.com/extension/elipsum/ here's how to generate multilanguage Lorem Ipsum text. This example uses English and Bulgarian sample paragraphs. Create a class in /protected/components/LoremIpsum.php. Wall of text incoming wohoo...
CGridview displays existent rows of the table (using DataProvider)
If you don't want to use any of the AJAX features of CListView and thus want to prevent that it publishes any of its asset files, you can extend it and create a sub class like this:
I used another example posted here a while back where the person was modifying the index.php and adding in a switch case for different domains and loading separate config files. This was actually too much for me, because all my portals are the exact same (as far as routes, modules, extensions, etc) and if I ever wanted to add another route it wouldn't be feasible opening up all the config files t...
Using CActiveRecord->updateAll() and CActiveRecord->deleteAll() with scopes and criteria requires some tricks that are explained in this article. While findAll() , find() and some other methods use scopes automatically, updateAll() and deleteAll() do not.
This page explains how to implement an event and catch that event in a behavior.
When talking about cookie-base login the Yii guide indicates the following:
In this wiki I will show how could be store last login date & time in database. First we need a field LastLoginTime (Type must be datetime). this field store a user login detalis (like - Date & Time).
I've gotten Yii running cron jobs, and wanted to explain briefly how I did it.
This Behaviour helps to view time/date/timestamp/datetime from db to local Date / Time / Date Time format and in local Timezone. And save into db in with db timezone and db format. You only need to include this behaviour in models where need this facility.
Like gmail, if you have tree or more unsuccessful login attemps a captcha appears