The main configuration of the file ( main.php ) is as follows: I can connect to the database successfully, but when generating a model from Yii Code Generator it tells me that the table does not exist. Answer Table exists? Gii generates a model based on table. First you need to create a table. If you use console version gii,
Tag: yii
Fatal error: Call to a member function isAttributeRequired()
I am having the following form The above form throws an error as I am new you yii framework so i am unable to guess where the error is. can anyone help Edit 1 Edit-2 If remove <?php echo $form->labelEx($model,’oldPassword’); ?> am getting error as Answer The $model variable does not contain a Model object, check if you you pass
Jquery – Uncaught TypeError: Cannot use ‘in’ operator to search for ‘324’ in
I’m trying to send a Get request by ajax and output json data that is returned by server in html. But, I got this error. This is my code that sends a Get request to php file by ajax. When I use $.each method, it get the error that I showed in the above. This is my PHP code that
How to create a migration in YII?
I have just started with YII and I am trying to create a new migration. I am using Xampp and it is located in the d drive of my system. The command that I am trying to use is: When I run the above command nothing happens, neither do I get an error message nor there is any error. I
Get category tree recursively (Yii)
I have a table with following structure: categories id name parent_id I want to get the tree of categories with single function. I’ve written something like this in my model, but it doesn’t work. Can someone help me with this? Thanks. Answer I’ve finally solved the issue. If someone interested, here’s the code:
Yii – dynamically change rules from controller
Let’s say I have a product which can have a colour. Depending on the product type, the colour field may or may not be required. If colour is always required, I would have the following in the product …
CListView in Yii Framework
I have started working on yii framework and I am following the yii blog tutorial to learn basics of yii framework in this tutorial they have used a ClistView in posts view but i am getting an exception This is the code that i have used in view file: This is what my PostsController contains: I can’t find out where
RabbitMQ and Yii console callback error
I am trying to get RabbitMQ working with the Yii console in order to send transactional emails, but I am experiencing problems with getting the PHP-AMQPLib library to work within Yii. My code is …
“Invalid parameter number: parameter was not defined” Inserting data
I’ve been using Yii’s active record pattern for a while. Now, my project needs to access a different database for one small transaction. I thought the Yii’s DAO would be good for this. However, I’m getting a cryptic error. CDbCommand failed to execute the SQL statement: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined Here is my code: This constructs