- Este artigo está disponível também em português do Brasil.
Maybe it looks simple, but some time ago I need some time to find a solution of this case. I finally got it, and I want to share that I also experienced such cases. So that it can make reference.
I was looking around wiki and found that was no approach as the one I did so I guessed this is worth to write.
With Yii you can use one CActiveForm for collecting data for two or more models with ajax validation and client validation.
If in your application you have to proceed to a complex SQL query that is not associated to a model, you will use CDbDataReader like it is described in the Yii documentation. An example could be
Whatever reason, it turns out to be easy enough to add that feature to your application. :)
This is what I did. Its the EASIEST solution that I know of. I just reused the advanced search done in CGridView.
Using filters on CGridView with CActiveDataProvider is easy, but with CArrayDataProvider it is a bit tricky.
I have had to do this a couple of times now so I figured I would share it with the community. I am going to keep this short because I really hope that you are familiar with jQueryUI's Sortable class before starting this tutorial.
$P$
.If you coming to Yii with experience with Zend Framework for example, most likely you get used to
Zend_Registry::get('paramName');
Zend_Registry::set('paramName');
I wanted to keep all the I18N related translations in separate files, so that I would not need to modify the view files or the model files every time I need to update or fix the translations of application's source language.
In this How-To I'll show you:
It is actually mentioned in the documentation
While there is a reasonable amount of documentation regarding CForm (form builder) and file uploads seperately, there really is not any coverage of both in combination.
I build this simple PHP class (DialogBox.php at the bottom of this wiki) to help you in the dialog box usage on Yii applications. The goal is run any Yii actions into this dialog box and return the resulting value to the calling instance.
Some of you have experienced the need to log some information while doing unit testing, due to the fact that the information given in the summary is just not enough, to know why the test is actually failing. this article focuses on 2 ways to get you logs up and running again.
First of all, You must change component config to enable the default Yii CSRF validation.
YII_DEBUG
to true (by default, it is defined in index.php
)
and put alongside error_reporting(E_ALL);
.
Then errors and warnings will stop the execution an...How to create a simple (non-RBAC) authorization system