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
1 answer

How to assign new values to saved data in yii 1?

I have following code in my controller: public function actionAdmin() { $model=new MForm('search'); $model->unsetAttributes(); // clear any default values if(isset($_GET['ChManageForm'])) …
phpdev
  • 511
  • 4
  • 22
0
votes
1 answer

yii1 validation rule with special conditions

Im having trouble with Yii1 validation. I have listbox with contact types and i want email validation to work only when contact via email is choosed. So Im using custom rule to check if its not empty: public function…
vyckiuz
  • 157
  • 10
0
votes
0 answers

yii1 GridView Pagination not updating Grid when changing Page

I am still very new to yii1 and fight now with a GridView. I have build a Search Form and when sending of the form, the page gets re-loaded and the GridView shows up with the results. The form goes to the Controller action and gets the appropriate…
Luka
  • 748
  • 2
  • 9
  • 36
0
votes
0 answers

Yii 1.x - required field saves empty

I have a field set as required in the model, yet I have seen users saving it as an empty string (ie. ''). When I tested it, I do receive the "Cannot be blank" message properly, so don't know how to prevent this in the future. Do I have to specify…
benomatis
  • 5,536
  • 7
  • 36
  • 59
0
votes
1 answer

How to impliment links in yii 1?

I have following code: return array( ULogt::UPDATE => ' ' This code locates in the class called links.php. I need to navigate to ('viewform', array('model'=>$this->loadJson($id)),…
phpdev
  • 511
  • 4
  • 22
0
votes
1 answer

how to retrieve data from json in json

I have following code in my contoller: public function actionForm($id) { $jsonfile=ChForms::model()->findByPk($id); $decodedJson=json_decode($jsonfile->json, true); var_dump($decodedJson); return $decodedJson; …
phpdev
  • 511
  • 4
  • 22
0
votes
1 answer

how to use creare URL in yii1

My controller is located in following folder Controller/SiteAction/1700/Participate and my view file is located in views/site/eventview. I should impliment the button inside eventview that navigates to Controller/SiteAction/1700/Participate. And I…
phpdev
  • 511
  • 4
  • 22
0
votes
0 answers

yii1 How to use a Subquery with query builder

I am new to yii1 and I'm now trying to create the following query in yii1 with the query builder. SELECT id, parent_id FROM categories WHERE parent_id NOT in (SELECT distinct id) GROUP BY parent_id, id I have done the following so…
Luka
  • 748
  • 2
  • 9
  • 36
0
votes
1 answer

Yii1 web application change the language by itself

I'm working on yii1 web application, i will mention my problem in simple way: i have home view page, i have created url as the following : link in my Home controller i have …
0
votes
1 answer

Json array sort alphabetically in yii1

I am stuck with a problem . I have an json array which contains categories,I need the array should be sorted alphabetically based on the category name. Here is my code. Controller $post = file_get_contents("............"); $model =…
Pooja Krishna
  • 193
  • 1
  • 5
  • 26
0
votes
1 answer

Yii1, prettry url issue

I want to make url like this in Yii1 http://example.com/customer-name. It would list jobs for the customer-name, this customer-name will be changing dynamically for example customer-name can be customer-name=IBM or customer-name=abc-mn or…
M-Ali
  • 23
  • 5
0
votes
1 answer

How to display temp array data to client

My form will submit data and get a result on the same page to the user for only viewing. The result will not save any where. my image form is here As above image select 2 parameter which save on Db and 1 length which is temp . On select length…
0
votes
1 answer

ajax validation in TblActiveForm

I faced with some problem in TblActiveForm. I have few models in 1 action and I need validate it in ajax. The simple server validation works fine, but I can't do ajax validation. In view file I have 3 tabs each of them display corresponding models.I…
YuriiChmil
  • 441
  • 1
  • 5
  • 18
0
votes
0 answers

How to get CGridView total records in afterAjaxUpdate (yii)

this->widget('bootstrap.widgets.TbGridView',array( 'dataProvider'=>$model->search(), 'filter'=>$model, 'afterAjaxUpdate'=>'function(id, data){debugger;}', 'template'=>'{items}{summary}{pager}', On filter, I want…
sujal
  • 1,058
  • 3
  • 18
  • 29
0
votes
0 answers

Specifying the number of rows per page in Dompdf

this is my controller code for pdf view define( 'DOMPDF_ENABLE_AUTOLOAD', FALSE ); require_once( Yii::app()->basePath . "/../vendor/dompdf/dompdf/dompdf_config.inc.php" ); $dompdf = new DOMPDF(); …
Bloodhound
  • 2,906
  • 11
  • 37
  • 71