yii1.x Questions
2
Solved
The controller:
controllers
|-FooController.php
|-BarController.php
The views:
view
|-foo|
| |-index.php
| |-error.php
|
|-bar|
|-index.php
How to render the error.php view with an action of...
4
Solved
I need to insert multiple ActiveRecord object in Yii,if all of them inserted
$transaction = Yii::app()->db->beginTransaction();
for ($i = 0;$i < 10;$i++){
$model = new Mymodel();
$model...
Ontologism asked 29/8, 2013 at 18:3
4
I have below code:
$inputs = "1,2,3,4,5";
$sql = "SELECT * FROM obj WHERE id IN(:input)";
$commond = Yii::app()->db->createCommand($sql);
$commond->bindValue(":input", $inputs , PDO::PAR...
1
I used PHPword to create a word document in my web application but I coud not implement list. I used the following code:
$PHPWord = new PHPWord();
$temp = $PHPWord->loadTemplate('temp.docx');
$...
8
Solved
I have a table like this:
(id, name, version, text).
(name, version) is unique key, how can i make a rule to validate this.
Coplanar asked 12/3, 2012 at 16:30
5
Solved
How to get base URL in a Yii CConsoleApplication application?
I tried Yii::app()->request->getBaseUrl(true) and ended up with the following error.
Undefined index: SERVER_NAME (/var/www/...
Rodeo asked 19/12, 2012 at 11:29
8
Solved
2
Solved
I want to add a column at the seventh place in the table, I am using
$this->addColumn('table_name','column_name','type');
adds the column at the end. Is there any way where I can mention th...
8
Solved
I want to force all users to log in before accessing pages of my site. I have followed Larry Ullman's tutorial Forcing Login for All Pages in Yii.
According to the tutorial you can make an excepti...
2
Solved
I am trying to build a multi-page form with Yii, but am quite new to PHP and Yii and am wondering what the best practice is for writing a multi page form. So far, what I am planning to do is to add...
2
I have a problem with CJuiDatePicker in the module JQRelcopy on Yii framework.
I use this module as I have a form with a datepicker field to be copied as many times as the user wishes.
The module w...
Devious asked 29/11, 2012 at 13:50
1
Solved
I have an array of active records and want to change some field of them with a loop in this manner:
$error = false;
foreach ($items as $item) {
$item->is_paid = self::PENDING;
$error = $erro...
Risser asked 3/4, 2013 at 15:49
1
© 2022 - 2024 — McMap. All rights reserved.