Yii

Pagination for a table contents in yii

两盒软妹~` 提交于 2019-12-25 14:15:51
问题 I'm using Yii application. In that how to give pagination to a table contents (not using cgridview). In view, <table data-provides="rowlink" data-page-size="20" data-filter="#mailbox_search" class="table toggle-square default footable-loaded footable line-content" id="mailbox_table"> <thead> <tr> <th></th> <th data-hide="phone,tablet">From</th> <th>Subject</th> <th data-hide="phone" class="footable-last-column">Date</th> </tr> </thead> <tbody> <?php foreach ($model as $item) { if ($item-

(Yii2) Variable not working from post

空扰寡人 提交于 2019-12-25 12:45:19
问题 This is my simple index.php file <?php use yii\helpers\Html; use yii\widgets\ActiveForm; $this->title = 'Qwert'; ?> <?php $variable=1; //that variable $f=ActiveForm::begin() ?> <?php if($variable==1){ echo Html::submitButton('First Button',['name'=>'b','value'=>1])."<br/>"; }else{ echo Html::submitButton('Second Button',['name'=>'b','value'=>2]);} if(Yii::$app->request->post('b')==='1' ) {$variable=2;} if(Yii::$app->request->post('b')==='2' ) {$variable=1;} ?> <?php ActiveForm::end() ?> So I

update session variable in yii [duplicate]

守給你的承諾、 提交于 2019-12-25 11:13:41
问题 This question already has an answer here : Value with same name in Array [closed] (1 answer) Closed 6 years ago . I want to know how can i update my session variable, in my controller, when i am on page1, in my public function actionpage1() i have this code $quantity=1; $sessionCart[] = array('product_id' => $_POST['documents'], 'document' => $productInfo->name, quantity'=> $quantity); so my default quantity is 1, And when i go to another page page2, and click on update button, I want my

Yii: Repetition of data in sql query

好久不见. 提交于 2019-12-25 10:03:27
问题 I am a Yiibie and I have a question that I have a query which gives me the top 5 Ngo's of every month based on the rating of the ngo. But the problem is that Ngo's name are repeated in the top 5 and I want that ngo's name should not be repeated in the list of top 5 ngo's. Here is the view file. <div class="main"> <div class="banner"> <img src="<?php echo Yii::app()->request->baseurl;?>/img/stat1.jpg" style="width: 1170px"> </div><!--banner ending here--><br> <div class="container" style=

Yii: Repetition of data in sql query

你说的曾经没有我的故事 提交于 2019-12-25 10:02:22
问题 I am a Yiibie and I have a question that I have a query which gives me the top 5 Ngo's of every month based on the rating of the ngo. But the problem is that Ngo's name are repeated in the top 5 and I want that ngo's name should not be repeated in the list of top 5 ngo's. Here is the view file. <div class="main"> <div class="banner"> <img src="<?php echo Yii::app()->request->baseurl;?>/img/stat1.jpg" style="width: 1170px"> </div><!--banner ending here--><br> <div class="container" style=

how to use isset inside addCondition in yii criteria

女生的网名这么多〃 提交于 2019-12-25 10:00:16
问题 Hi I've been trying to check if a field is existing using isset inside addCondition like this $criteria->addCondition('isset(status_id)'); but no luck. Can anyone suggest the right syntax for this? thanks 回答1: For checking a variable, you can use isset(). But what you are trying to do is not the correct way. The addCondition method is not supposed to execute PHP functions. Check the documentation But If you want to check the value in status_id , tou can do like this - $criteria->addCondition(

how to use isset inside addCondition in yii criteria

ぐ巨炮叔叔 提交于 2019-12-25 09:59:09
问题 Hi I've been trying to check if a field is existing using isset inside addCondition like this $criteria->addCondition('isset(status_id)'); but no luck. Can anyone suggest the right syntax for this? thanks 回答1: For checking a variable, you can use isset(). But what you are trying to do is not the correct way. The addCondition method is not supposed to execute PHP functions. Check the documentation But If you want to check the value in status_id , tou can do like this - $criteria->addCondition(

Searching and sorting by related model in Yii with CGridView when Relation is a key in the same table

狂风中的少年 提交于 2019-12-25 09:38:18
问题 There is a comprehensive article about searching and sorting by related model in CGridView here: http://www.yiiframework.com/wiki/281/searching-and-sorting-by-related-model-in-cgridview/ I've successfully implemented this recipe a number of times. However, now I am trying to search and sort by a relation that is in the same table (it defines the parent_id). See 'parent' relation below: public function relations() { return array( 'parent' => array(self::BELONGS_TO, 'Category', 'parent_id'),

Progress dialog keeps on displaying in android studio

*爱你&永不变心* 提交于 2019-12-25 09:01:04
问题 I am newbie to android development. I am using android studio for my application. I have created a DB and then created a web service in Yii, tested it on ARC and use the GET method and it shows the result perfectly. After that i created an app in which i want to use the web service and use it's get method to display a result. Below is my DB table structure The scenario is when ever a user enters the id in the app and hit the submit button it should show the corresponding username . For this

Page redirection issue in Yii

有些话、适合烂在心里 提交于 2019-12-25 08:57:56
问题 i have a problem in my application which is built in Yii... when i want to visit a link that show me an error in FireFox as.. The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. and in chrome it says... This webpage has a redirect loop one thing more it is working fine on local machine; no issues but the above error is on live server... Now what is the main issue here..? 回答1: It seems that the