Yii

behat step “I should see” does not see

好久不见. 提交于 2019-12-22 18:19:20
问题 Using Behat in Yii framework, I am observing its quite strange behaviour: Behat does not find some text when using steps like Then I should see "some text" Some text it finds normaly, but some - not. To be sure that I am on the page I think I am on, I've added sort of markers in the view files and Behat sees them. So, the scenario is Scenario: editing journal Given the following journals are present: | name | link | description | | Murzilka | http://www.murz.com | advanced child journal| |

How can I hide user_id from URL using yii framework?

左心房为你撑大大i 提交于 2019-12-22 16:44:55
问题 I am using the yii framework and have different user accounts. When I want to have a look at the view page of user 4 I have to enter an url like www.mydomain.com/user/4 for update I have www.mydomain.com/user/update/4 . Is there a way so that I can hide the user id from the url line? How can I set a route like www.mydomain.com/user/username and www.mydomain.com/user/update/username ? Do I have to modify the routes? What if the username contains an @ symbols? 回答1: If each user has a unique

How can I hide user_id from URL using yii framework?

左心房为你撑大大i 提交于 2019-12-22 16:43:11
问题 I am using the yii framework and have different user accounts. When I want to have a look at the view page of user 4 I have to enter an url like www.mydomain.com/user/4 for update I have www.mydomain.com/user/update/4 . Is there a way so that I can hide the user id from the url line? How can I set a route like www.mydomain.com/user/username and www.mydomain.com/user/update/username ? Do I have to modify the routes? What if the username contains an @ symbols? 回答1: If each user has a unique

Doing Join query using CDBCriteria

 ̄綄美尐妖づ 提交于 2019-12-22 14:50:29
问题 I am trying to do a Join query using CDBCriteria in Yii framework. The issue is the join query works successfully but it does not display the columns from other tables. I am doing in the following way $criteria = new CDbCriteria; $criteria->order = 't.id desc'; $criteria->select = '*'; $criteria->join = ' INNER JOIN table2 INNER JOIN table3 INNER JOIN table4'; When i run this, I can see only the mail table1 columns displayed. Other columns are not shown. In my model class, I have the relation

How to show insert query generated through $model->save() function

别等时光非礼了梦想. 提交于 2019-12-22 14:47:22
问题 I want to show the query which is generated when we call the function $model->save() of a model. I did not find any way to do it. If anyone knows please reply. Thanks 回答1: Change your 'db' component in your config file - 'db'=>array( … 'enableProfiling'=>true, 'enableParamLogging' => true, ), Then check wherever you are logging everything. If file, it will be application.log file. Else on the page itself. To enable logging in file - 'log'=>array( 'class'=>'CLogRouter', 'routes'=>array( array(

Yii removing application directory name from URL

拥有回忆 提交于 2019-12-22 14:06:41
问题 Okay seems like this is a pretty common problem, but I can't find a definitive solution on the forums. My Yii is set up like this /webroot/framework /webroot/app /webroot/requirements The app folder hosts the yii application however my url looks like : site[dot]com/app/site/index How do I remove the 'app' portion from the URL. I tried moving my .htaccess file to the webroot folder and it redirects but 'app' still shows up in the url Here are the contents of /webroot/.htaccess <IfModule mod

Changing the Page Labels in Yii?

老子叫甜甜 提交于 2019-12-22 13:51:12
问题 I would like to change the the labels of pages in Yii. I used Zii.widegt.CListView to show the list of items. The default structure of yii pagination is [previous] 1 2 4 5 6 7 [next] required structure is < 1....10 11 12 13 14 ....40 > . I read "How can I customize the labels for the pager in Yii?" which is helpful, but how can I show the firstPageLabel as page number 1 instead of << and lastPageLabel as 40 instead of >> . 回答1: If you can't find a way to pass in the total item count (i.e. 40)

yii CActiveForm submitting by AJAX

回眸只為那壹抹淺笑 提交于 2019-12-22 11:58:26
问题 I create form using the following code: <?php $form=$this->beginWidget('CActiveForm', array( 'id'=>'contacts-form', 'enableAjaxValidation'=>false, )); ?> Is there any way to submit the form by AJAX? Remember not I am not talking about AJAX validation. 回答1: This helper ajaxSubmitButton function isn't terribly useful, especially since it uses jquery.ajax() without using the "Promise interface" in jquery 1.5+, so you have to process the response through the success callback. This would have been

PDF or Word creation documents with Yii?

大城市里の小女人 提交于 2019-12-22 10:36:57
问题 Hello I'm building an application with Yii that will now generate reports. My client wants to edit the reports after these are generated. I think the best option is creating a Word document so my client will be able to edit it, but I can't find information or extensions to create Word documents with Yii Framework. I've also seen but not test yet a couple of PDF extensions such as DOMPDF, tcpdf and Zend_PDF. But if I generate a PDF report, then, how is my client going to edit this file? Guys I

Multiple CJuiAutocomplete in Yii - items not rendering

允我心安 提交于 2019-12-22 10:36:34
问题 I need two CJuiAutocomplete items on my view page. Unfortunately - only one of them is rendering items properly. The other one - renders empty rows. I checked in firebug and the values are retrieved from database properly. Actually if I change the order of the registerScript - only the autocomplete from last registerScript renders items properly. Here is my code: <?php $this->widget('zii.widgets.jui.CJuiAutoComplete', array( 'name' => 'autocities', 'sourceUrl'=>$this->createUrl('projects