yii

A CMS based on Yii ?

Hi - i've been with Yii for a few months and before I use main CodeIgniter, SilverStripe in my projects. Does anyone know a good Yii based CMS such as SilverStripe based on Sapphire or EE based on CodeIgniter ? My experience is working with Yii is much more easier and straightforward assuming you are good OOP coder but Yii is still you...

Problem in Saving Multi Level Models in YII

My Table structure for user and his adress detail is as follows CREATE TABLE tbl_users ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, loginname varchar(128) NOT NULL, enabled enum("True","False"), approved enum("True","False"), password varchar(128) NOT NULL, email varchar(128) NOT NULL, role_id int(20) NOT NULL DEFAUL...

How to raise CComponent event in Yii

Let's assume I have Component (say Graph like Yahoo Finance) rendered on the page. Component view template contains bunch of a_hrefs which I wanto to switch period in graph. I created Event and Event handler in Component. I have two questions: How to raise event on Graph Component via those a_hrefs (should they be part of Graph?)? How ...

Yii $loginUrl='/' problem (not redirecting to the login page)

I've noticed that if your site is located at the root of the domain, like www.example.com instead of www.example.com/website/ then if you set your $loginUrl='/' in the config of Yii, the redirection will not work, because the url is stripped to an empty string while processing. To overcome that I've added public function init() { pa...

Can I refresh a Yii CGridView from js?

When a "Create" modal dialog is submitted via XHR Then the rows in a Yii CGridView should be refreshed. I've tried to achieve this by rendering the new gridview in the XHR "create" action and then inserting it into the page via $("#list").html(response), but rendering a CGridView causes jQuery <script> include tags to be registered for ...

Where to learn Yii?

Hi, I have been trying to learn Yii without luck. I find Zend Framework, Kohana, Code Igniter among other frameworks much easier to learn than Yii. The documentation also su**s. Can you post links to easy-to-understand and well written tutorials/articles? The official documentation is filled with grammar errors and seems to be rushed......

Most efficient way to do a conditional mysql join on multiple tables? (Yii php framework)

I have five tables: tab_template template_group group user_group user Tab_template's are organized into groups with the template_group relational table. Users's are organized into groups with the user_group relational table. Group's can be public or private (using a tinyint boolean column in the table). I want to query for all of th...

PHP framework of intermediate complexity, in between CodeIgniter and Yii ?

Something easy like CI (this means mandatory good, easy, up to date documentation). But also with some more features than CI. Yii has lots of features, but it is also more complex (and it kind of forces you to have to use lots of it features). That means adding some functionality to your web-app takes three times as long because you hav...

coding standards in yii framework

is there any coding standard which follows yii framework, and where it is specified ...

using relations with CGridView

Hi, I'll describe the problom as clearly as I can. I have activeDataProvider: $dataProvider=new CActiveDataProvider('Menu', array( 'criteria'=>array( 'with' => array('roles'), ), )); then I'am using CGridView with checkbox: $this->widget('zii.widgets.grid.CGridView', array( 'id'=>'menu-grid', 'selectableRows...

how to force to refresh value of model in yii

let's say I have model A with relation to B. When I write: $a = A::model()->findByPK(1); $a->B->doSomething(); and now B may by changed (by other user for instance). When I write: $a->B->doSomething(); it uses old values of B. What I should do to force to refresh value of B before doSomething(). ...

Yii paginate related data

What is the best way to paginate related data in Yii? For example I may have post and I want to paginate comments. ...

Getting form data in Yii to a CActiveRecord model works for one model but not for another

I'm getting a submitted form in this way: $resume->attributes = $_POST['ResumeModel']; $profile->attributes = $_POST['UserProfile']; Both CActiveRecord models are correctly populated before this from the corresponding tables, they have the correct data and all. Both models' data is present on $_POST as modified by the form. But it see...

yii - difference between radioButtonList and activeRadioButtonList

in the yii framework what is the difference between radioButtonList and activeRadioButtonList? ...

yii - using relation HAS_ONE to get data from the related table to display in list page

I have two tables big (id, bigs_name, smallid), small(id, smallguys_name) therefore two models - big and small i have used the following relation in the big model, (I hope this relation is correct) 'has_small' => array(self::HAS_ONE, 'small', 'smallid') by default the actionIndex was created as public function actionIndex() { ...

yiiadmin - many-to-many in yii-framework admin interface

Hi, guys! I am currently extending yii-s admin extension, yiiadmin. What would be the easiest way to get a listBox multiple-select field in model-create view, that would display many-to-many relation, for example I have a 'pivot' table that holds these article-category relationships, along with Article and Category tables. I alrea...

Passing models in array format to views in YII

How can I pass the model in array format. I want to pass models in this format from controller to view:- Users[user_contact]=Contact Users[user_contact][contat_city]=City Users[user_contact][contact_state]=state This is what I am doing public function actionCreate() { $user = new Users; $presContact = new Contacts; $presCi...

Yii framework generated forms field types dont corespond to database

I am using gii to generate CRUD operations for a large number of tables, but the generated form uses a text box for the boolean data types instead of the checkbox In my table model I modified the rules function to use a boolean validator for my fields public function rules() { return array( ... array('single, random, public', 'boo...

Netbeans 6.9 uses 50-60% CPU

Netbeans eats 50-60% CPU all the time and I installed NB for PHP only and Yii framework. My PC detail: Intel(R) Pentium(R) Dual CPU E2200 @2.20GHz(2CPU), 1526MB Ram. Should I upgrade my PC or have right way to solve out this problem? ...

How to declare many-to-many relationships if the join table is in a different database?

For example, posts table is in db1, categories table and category_post_join table are in db2. How to declare a many-to-many relationship between Post model and Category model? 'categories'=>array(self::MANY MANY, 'Category', 'category_post_join (post_id, category_id)') works only if all tables are in the same database. ...