Assume that you have teachers and students model.
Assume that you have teachers and students model.
This page is created to supply short directions and general tips for managing a Yii application in Codelobster PHP Edition.
In this wiki, I try to implement a simple authorization schema without putting much logic inside a file or into database table. We are constructing authorization hierarchy inside the controller. We are getting roles for the current user from database table and assigning only roles to user that are declared in the particular controller. We have brought down the work of loading of auth data at ma...
How to check the online users or how to logout a specific user from your admin panel? This wiki shows how to do that
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 someone want to send formatted HTML mails from a console application she/he will probably come across the problem of rendering view files.
Here is a way to dynamically extend tabs based on clips.
Probably even more complex things could be done.
You have different collections in MongoDb with de-normalized attributes. As you may know, due to its not-join nature, MongoDb tends to encourage repetition of the same value in different collections (de-normalization). In this MongoDb is opposed to a more SQL-like approach where you usually reference only the ID of the value with a foreign key.
Clearing CGridView filters and sort orders from the web pages, is usefull for the end user. Yii does not seem to propose a standard method. Furthermore, this is especially usefull when filters are "remembered" in the user's session.
I did not invent this instructions, I read it somewhere and re-organized in my way as I was trying and it works for me;
While rewriting the PcReportContent extension I'm maintaining I've bumped to a challenge. This wiki was born out of it.
Yii's CArrayDataProvider is very helpful to display model relation data's directly on it.But it is truely a confusing one because by default it will assume a table field named “id” as primary key for its pagination purpose and what if you dont have field named “id” as primary key on your table? so its truely confusing and if you tried to display without an “id” field on ur table you will get an...
All the basic functionality for an action used by the xupload extension. Check resources for the source code of this action
First of all this is a very common problem, for more details see this post http://www.yiiframework.com/forum/index.php/topic/52052-upload-file-with-any-charset/
If you are lucky enough and have the privilege to develop on a Linux based environment, this little tip might boost-up your TDD process (at least the Unit Testing part). Please note, that this should work just fine with Apple computers also, but not tested!
Since version 5.4 PHP can work as a simple webserver so you can develop Yii applications without installing Apache. That's how to use it:
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...
This tutorial is for people that are integrating Yii into WordPress. Meaning that WordPress is the host platform, and that Yii will be handling AR, CRUD, etc.