In addition to the opcode cache, APC can also serve as a user cache for Yii via [CApcCache]. It should be noted that this will make APC's memory needs less predictable.
In addition to the opcode cache, APC can also serve as a user cache for Yii via [CApcCache]. It should be noted that this will make APC's memory needs less predictable.
This example uses a MySQL DB with a table named tree
with the fields id
, name
, and parent_id
. The parent_id
will be NULL
for root elements. The SQL is kept simple (no autoinc, no FK, etc).
This article describes an implementation of multi-tenancy using Yii and MySQL.
In advance template there is already a file yii. And there is no need to run it as php, it is Linux script.
There are cases you want to update a record on CGridview directly
Simple as that. I have placed this action in my extension folder like:
This wiki explains how to add summary data from related models into your Yii Framework 2.0 gridview with filtering and sorting by the summary columns.
[CMenu] offers great functionality and the ability to customize just about every aspect of the output. There are many times when I need to create a drop down menu or simply modify the look to make the designers happy. Because this seems to be a common task for me, I figured I would share my code to create a very simple drop down menu that other people could use.
Step1: Download the extension from path 'http://code.google.com/p/yii-mail/downloads/list' .
Yii2 comes with a charming twitter bootstrap version 3. But if it is less, then you can integrate with web templates that you like. One example is wonderfull template "adminLTE"
There are many ways to automate the setting of timestamps in yii ActiveRecord models. Three are presented here:
Let's say, for example, that you are developing a blog or some kind of CMS and you want to track the number of times each post was viewed (maybe to show a list of the most viewed ones).
A few days ago, i worked for CGridView exporting functional for my client. He asked me to create a simple exporting to a CSV file a CGridView search results.
Here is a small guide how to get console commands running inside modules & extensions. For this guide I used a fresh yii2 basic application template.
Note: Please also take a look at the newer EMenu extension. This works even better that the deprecated CDropDownMenu!
Note: Before reading this wiki you should have read the caching part in the Yii guide
He im giving you a very simple example ie how you can store an image to your blob field in a table.Hope you already familiar with the normal image upload.
I installed phpseclib because I needed to do some AES encryption in my project. After all the hassle of installing php lib, I found out that Yii already has a security module (securityManager). I finally decided to keep using phpseclib because it has one big advantage over Yii securityManager module, it does...
If you started playing with Yii2's new GridView, you will soon realize that some things have improved quite a lot, but I am sure its going to be a bit confusing at first glance when you try to modify certain javascript behaviors like for example, its delete confirmation dialog box.
It's very common to see new Yii users confusing the relations HAS_ONE
and BELONGS_TO
, and getting it wrong means you won't get proper values back. And though we'll talk about HAS_MANY
as well, we're specifically omitting the MANY_MANY
relation because it's a whole different animal.