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
0
votes
2 answers

How to convert array to string in yii 1

I have following code in my controller in my yii 1application: $recipientRegion=1710; $data= Yii::app()->db->createCommand() ->select('user_group_id') ->from('user_rights') …
phpdev
  • 511
  • 4
  • 22
0
votes
1 answer

How to check whether row exists or not in yii 1

I have table called user_rights. It contains following fields rights_id, user_rule_id, user_p_id, user_group_id and region_id How can I get row which rights_id=15, user_rule_id=4, user_p_id=2, user_group_id=6 and region_id=100? How can I check…
phpdev
  • 511
  • 4
  • 22
0
votes
2 answers

delete by id is not working in yii 1

I have following code in my controller to delete files: public function actionDelete($id) { $current_user_id=Yii::app()->user->id; $condition = 'user_id=:user_id'; $params = array(':user_id' => $current_user_id); …
phpdev
  • 511
  • 4
  • 22
0
votes
1 answer

Saving another field value instead of id in drop down in yii 1

I have following code in my view dropDownList($model,'p_28', CHtml::listData(AdCourt::model()->findAll(),'id','name') , array( 'class'=>'form-control', 'style'=>'width:100%;', …
phpdev
  • 511
  • 4
  • 22
0
votes
1 answer

How to get url address of current redirecting page

I can navigate to one view in two ways: http://test.new.loc/ru/cabinet/intranet/update/ and http://test.new.loc/ru/plaint I used $this->redirect(array('/plaint'));in actionUpdate action (for this url…
phpdev
  • 511
  • 4
  • 22
0
votes
1 answer

running different codes when entered from different urls in yii 1

I have following code in my php class called Plaint: class Plaint extends CAction { public function run() { $model = new PlaintForm(); $this->runTests($model); ........... I need to run this class…
phpdev
  • 511
  • 4
  • 22
0
votes
1 answer

How to decode json data in CDetailView in yii 1

I have following code in my view: widget('zii.widgets.CDetailView', array( 'data' => $model, 'attributes' => array( 'id', 'name', array( 'label' => 'Company', 'type' => 'raw', …
phpdev
  • 511
  • 4
  • 22
0
votes
1 answer

How to call decoded json field values in view in yii 1

I have following code in my controller: $model=ChForms::model()->findByPk($id); $decode= $model->json; $res=CJSON::decode($decode); var_dump($res); return $this->render('index', array('model'=>$model, 'res'=>$res)); the result of var_dump($res)…
phpdev
  • 511
  • 4
  • 22
0
votes
1 answer

How to make second dropdown value the same as the first dropdown value?

I have following code in my view: labelEx($model, 'p_2_1', array('class' => 'col-xs-12 col-sm-2 control-label')) ?>
dropDownList($model,…
phpdev
  • 511
  • 4
  • 22
0
votes
0 answers

success functions is not working. How to use two types of responses in success function

I used moveuploadfile for uploading files and I have following code in my controller: $fsize = $_FILES[$key]['size']; if ($fsize > 2621000) { echo "sizeError"; return; } else { if (move_uploaded_file($_FILES[$key]['tmp_name'], $name)) { …
phpdev
  • 511
  • 4
  • 22
0
votes
1 answer

How to save array element names to the database?

I have following code in my model: public function getData($property) { $data = array( 'a_4_1' => array( 'RUB', 'USD', 'JPY', ), ); return…
phpdev
  • 511
  • 4
  • 22
0
votes
2 answers

How to implement validation to moveiploadfile(size and type) in yii 1

I have following code in my controller: if(move_uploaded_file($_FILES[$key]['tmp_name'], $name )) { echo 'Success'; } else { echo 'fail'; } I need to implement restriction for uploading files in terms of size and type. Users should not be…
phpdev
  • 511
  • 4
  • 22
0
votes
2 answers

Is it possible to put two URLs in an AJAX request?

I have following code in my send.js: function send_upload_file(){ var FD = new FormData(); FD.append( $this.name, $this.value); $.ajax({ url: 'upload', type: 'POST', processData: false, …
phpdev
  • 511
  • 4
  • 22
0
votes
1 answer

How to install composer on live server cpanel to make local installed library work on live

I uploaded my yii1 project to live server,there was a library (which I have installed it on local machine using composer) give an error (class not found), what I did was: Ensure that in my file access to autoload file in library correctly.…
0
votes
2 answers

How to replace const names instead of values in yii 1

I have following code in my controller: $model=new MForm; $list=MForm::model()->findAllBySql('SELECT form_name FROM m_form'); var_dump($list); It returns values of form_name(values are integer e.g 1, 2, 3 etc.) I created const in my…
user7294955