Questions tagged [yii1.x]

Old version of PHP framework Yii.

Yii Framework

Yii is a generic Web programming framework, meaning that it can be used for developing all kinds of Web applications using PHP. Because of its component-based architecture and sophisticated caching support, it is especially suitable for developing large-scale applications such as portals, forums, content management systems (CMS), e-commerce projects, and so on.

Yii 1 is the first version of the Yii framework. Yii 1.0 was released in December 2008 and it is no longer supported. Yii 1.1 was released in January 2010 and reached the end of life in November 2015. Since then it only receives security bugfixes and fixes that improve compatibility with new versions of PHP. In October 2014 the successor of Yii 1.1 was released: .

Official documentation can be found in the Definitive Guide to Yii 1.1. Further important resources:

270 questions
2
votes
0 answers

I need to convert this mysql query to Yii1 framework

I am trying to convert my SQL query into yii 1 . This is my SQL query select t.project_category,t.name,t.status,t.est_end_date,t.est_start_date,t.created_by, sum(x.tam),sum(x.w), AVG(x.percentage) as z,AVG(x.per_hr_cost) as…
Jiby John
  • 33
  • 7
2
votes
4 answers

Getting a raw SQL query with variables in Yii1

Is Yii1 has any native methods to get the raw SQL with variables built? I try to get a complex query built on a few subqueries using CDbExpression and CommandBuilder. I got this as a result: SELECT * FROM `news` `t` WHERE id IN (:ycp0, :ycp1, :ycp2,…
Alexander Yukal
  • 173
  • 1
  • 9
2
votes
4 answers

Yii 1 and Yii 2

I am new to Yii 2, Normally I use Yii 1 to develop web application, now Yii have new version of Yii (Yii 2), Do I really need to go for Yii 2? Is there any security risk in Yii 1? Because as I see Yii 2 is totally changed from Yii 1.
Mint
  • 179
  • 2
  • 7
2
votes
2 answers

Set Yii controller dynamically in unit-test

I'm running some unit-tests using PHPUnit, and hack my application pretty hard in those tests (no other way, old code-base). Some parts of the code-base use Yii::app()->getController()->createUrl(...); but in this case, there is no controller, so…
Olle Härstedt
  • 3,799
  • 1
  • 24
  • 57
2
votes
1 answer

How to save the names of muliple uploaded files to one field in yii 1

I used CUploadedFile in order to upload multiple files in my web applcation. I used following code for this purpose: public function actionCreate(){ $model=new Status(); $this->performAjaxValidation($model); if(isset($_POST['Status'])) …
yiideveloper
  • 121
  • 1
  • 6
2
votes
1 answer

http to https redirect in Yii framework

Well i know this looks pretty easy , but i have been working on it from a couple of hours now . but looks bit strange , there are quite a few solutions on having http to https permanent redirect , but are not working . I have a Yii application ,…
Anil Sharma
  • 2,952
  • 5
  • 29
  • 45
2
votes
1 answer

Yii cgridview last page pagination issue

I have simple Yii cgridview code with pagination. Pagination is working fine but in the last page I have faced one issue. For example, If I have 13 records in DB table, and set pagination for 10 pages per page then for first page It will show "1 -…
Dharmesh Goswami
  • 1,155
  • 2
  • 13
  • 30
2
votes
1 answer

How to prevent clearing file field after validation in Yii1

Now the problem is, I have validation rules for each field when i leave the form with an empty value [say Name field is left empty] purposely, it will give me the validation error which is obvious. but, the other parts of the filled form are kept…
2
votes
4 answers

arrays in foreach in yii 1

I have following code in my controller: $data= Yii::app()->db->createCommand() ->select('region_id') ->from('user_rights') ->where('user_group_id='.$findRegion['user_group_id']) …
phpdev
  • 511
  • 4
  • 22
2
votes
1 answer

How to use an element of json data instead of field in the widget to display full list?

I saved some data in json format into my database in one field called json. I used widget in order to display full list of products. widget('zii.widgets.grid.CGridView', array( 'id'=>'page-grid', …
phpdev
  • 511
  • 4
  • 22
2
votes
1 answer

How to develop dependant drop down without database

I have following code in my controller: public function getData($property) { $data = array( 'type'=>array( 'PC', 'Laptop' ), 'brand'=>array( '1'=>array( …
phpdev
  • 511
  • 4
  • 22
2
votes
1 answer

How to get attribute name from the widget in yii 1

I used widget in my web application to upload files. In my view file, I used following widget code: widget('application.components.FileUploadWidget',array( 'model'=>$model, 'attribute'=>'f_5', …
phpdev
  • 511
  • 4
  • 22
2
votes
1 answer

How to retrieve information from the database without createCommand?

I have following code in my controller: $listproduct=Yii::app()->db->createCommand() ->select('product') ->from('product_form') ->where('product_name=:product_name and type=:type', array(':product_name'=>'HP', ':type'=>$gettype )) …
phpdev
  • 511
  • 4
  • 22
2
votes
1 answer

How to get specific element of decoded Json in yii 1?

I have following code: public function actionsdf($id){ $dsf=UserLog::model()->findByPk($id); $decode=$dsf->text; var_dump($decode=$dsf->text); $res=CJSON::decode($decode); var_dump($res); } The…
phpdev
  • 511
  • 4
  • 22
2
votes
1 answer

How to show/hide an element on checkbox checked/unchecked states using jQuery

I have this code:
labelEx($model, 'd_options', array('class' => 'col-xs-12 col-sm-4 control-label')) ?>
phpdev
  • 511
  • 4
  • 22
1 2
3
17 18