Yii

Update Bootstrap Thumbail Grid - ajax request

∥☆過路亽.° 提交于 2019-12-23 21:42:30
问题 Scenario: I have a view with a twitter bootstrap thumbnail grid that shows the countries. When the user clicks one image, it is supposed to show the cities related to that country, in the same grid (screen). Technical: First I fill the dataProvider with countries, and then I should send a ajax request with the country id to my controller where it queries the database for cities related to that country and sends the new dataProvider, back to the view where it updates the same thumbnail

Yii2 Gridview get all selected row for all pagination

天涯浪子 提交于 2019-12-23 21:05:18
问题 I wrapped my gridview with Pjax widget like this \yii\widgets\Pjax::begin(); gridview \yii\widgets\Pjax::end(); in order to make the gridview make ajax request when I click on each pagination. I also use ['class' => 'yii\grid\CheckboxColumn'], in column as well. and I find that when I'm on first pagination I checked some rows and then go to second page and check some rows but when I go back to first page what I've checked is gone. My question is how can I keep all checkedrow for all

Strange error #32 on website's bottom using yii2

≡放荡痞女 提交于 2019-12-23 20:17:14
问题 I am using yii2 , and I have recently uploaded my whole website on the godaddy shared server. I have uploaded on the root folder my all other folders like controller , vendors , config etc Then I have uploaded my "web" folder files like index.php and themes etc to public_html folder. Everything works fine on the server but suddenly sometime it shows at the end of my page. This randomly appear when i refresh my server I am not sure. Error (#32) An internal server error occurred. The above

Yii2: How to show checked values in CheckboxList

余生长醉 提交于 2019-12-23 20:05:48
问题 I want to show checked values in my checkboxlist in Yii 2.0. Following is my code: Main Array: <?php $featureArr = array( 'Change Requester' => 'Change Requester', 'Clone Request' => 'Clone Request', 'Suspend Request' => 'Suspend Request', 'In-Process Requests Open in Edit Mode' => 'In-Process Requests Open in Edit Mode', 'Allow On-the-Fly Notifications' => 'Allow On-the-Fly Notifications', 'Additional Comments Field' => 'Additional Comments Field', 'Do Not Validate Draft Requests' => 'Do Not

Run yii controller/action on command line

╄→尐↘猪︶ㄣ 提交于 2019-12-23 19:08:55
问题 Is it possible to run yii controller/action on linux command line just like CodeIgniter usage? CI style: php index.php controller action 回答1: I'm not aware of running controller/action from the command line apart from making a GET request, however there are yii console applications (as opposed to web applications) that you might consider taking a look at here http://www.yiiframework.com/doc/guide/1.1/en/topics.console. I'm not sure what you are trying to achieve so it's hard to know whether

Yii addInCondition

旧街凉风 提交于 2019-12-23 17:54:27
问题 I've tried to get rows from table according to my conditions. My code: $conditions = array( 'id' => array ('148028','118508') ); $criteria = new CDbCriteria(); foreach($conditions as $key => $values){ $criteria->addInCondition($key, $values); } if(!is_null($limit)) $criteria->limit = $limit; $rows = Item::model()->findAll($criteria); These rows exist,but result is empty. Binding params exist in criteria object. Log looks like: system.db.CDbCommand.query(SELECT * FROM `items` `t` WHERE id IN (

Yii Fixtures Issue?

左心房为你撑大大i 提交于 2019-12-23 17:43:54
问题 I seem to be having a problem with fixtures in Yii. The problem seems to be the following, public $fixtures=array('projects'=>'Project'); The model Project exists and I have the fixtures in a file name tbl_project.php in the fixtures folder of tests and my table name is called tbl_project. Inside the fixtures file is the following. return array( 'project1' => array( 'name' => 'Test Project 1', 'description' => 'This is test project 1', 'create_time' => '', 'create_user_id' => '', 'update_time

How do I access the property of a widget

社会主义新天地 提交于 2019-12-23 17:17:57
问题 I'm new to the Yii framework and I'm trying to access a property of the of a widget let's say CMenu where I want to change the values of some public properties like activeCssClass, firstItemCssClass, lastItemCssClass, htmlOptions etc. so how do you change the property of a widget in Yii. Details: I'm using Yii version 1.1.12 (Aug 19, 2012) and I'm trying to generate a multilevel menu but I need to change the values of some public class parameters and I don't know how? 回答1: Well, normally you

No error message when Login fail Yii2

我与影子孤独终老i 提交于 2019-12-23 12:42:42
问题 I'm currently using Yii2 framework. In the Login page,when I have a failed login, it just refreshes the view, but no errors displayed. Here's my current view: <?php use yii\helpers\Html; use yii\bootstrap\ActiveForm; /* @var $this yii\web\View */ /* @var $form yii\bootstrap\ActiveForm */ /* @var $model \common\models\LoginForm */ //$this->title = 'Welcome to my site'; //$this->params['breadcrumbs'][] = $this->title; ?> <div class="site-login"> <h1><?= Html::encode($this->title) ?></h1> <div

File download with Yii

天涯浪子 提交于 2019-12-23 12:26:01
问题 I am using the Yii framework and i have the website to allow the admin to upload a text file or a pdf.Now I want to allow the user to click on a link and start downloading that file.How is this achieved inside the Yii framework? I am storing the files at Yiiapplication/uploads/downloads/test.txt. I have tried the following code that i have found online but it is not working. Yii::app()->request->sendFile(Yii::getPathOfAlias('webroot').'/uploads/downloads/23602414.txt','click me'); Do i need