Yii

Hash password compatibility between Yii ( Php Crypt ) and Laravel Sentinel

南笙酒味 提交于 2020-01-16 11:59:03
问题 I'm building a laravel app using Sentinel, based in an old system code in Yii. Purpose is be able to login in new system with old users / old db. I first has to resolved model issue: Custom Model and fields with Sentinel / Laravel Now, it is ok. I have a last issue, it seems to be hashing password from different ways. When I check the hash method in Yii, I can find that it use Blowfish algorithm: /** * CPasswordHelper provides a simple API for secure password hashing and verification. * *

Yii2. Pjax and Session

馋奶兔 提交于 2020-01-16 07:18:49
问题 For testing reasons, I am trying to use Pjax in a widget. In the view: $testArgs = [ 'param' => 'test' ]; Yii::$app->session->set('testArgs', $testArgs); echo Test::widget($testArgs); Then in the widget: class Test extends Widget { public $param; .. public function init() { .. } public function run() { Pjax::begin(); echo "<a href='test/add'>[ + ]</a> | <a href='test/remove'>[ - ]</a>"; Pjax::end(); } } Then in TestController: public function actionAdd() { $testArgs = Yii::$app->session->get(

Yii: Getting data on the basis of highest average rating

回眸只為那壹抹淺笑 提交于 2020-01-16 04:47:11
问题 I am a yiibie and I want to get the top 5 ngo's from my "NgoRateReviewNgo" table. The condition for the top 5 Ngo's is that it should first find the average rating of the Ngo's and after that those 5 Ngo's which have highest average rating gets displayed. This is the code for my view file and contains the SQL query <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=

How to put default value in CJuidatepicker in Yii?

扶醉桌前 提交于 2020-01-16 01:16:09
问题 I have the code below to display a calendar input in Yii form. <?php $this->widget('zii.widgets.jui.CJuiDatePicker', array( 'name' => 'publish_date', 'attribute' => 'publish_date', 'model'=>$model, 'options'=> array( 'dateFormat' =>'yy-mm-dd', 'defaultDate' => '2014-3-4', 'altFormat' =>'yy-mm-dd', 'changeMonth' => true, 'changeYear' => true, 'appendText' => 'yyyy-mm-dd', ), )); ?> The default value work on the calendar but I want to show it by default in the calendar input too when the form

error yii2 upload Call to a member function saveAs() on null

北慕城南 提交于 2020-01-15 10:43:57
问题 I am new programmer world and ask for your help guys, I have error "Call to a member function saveAs() on null" This code in models [['file'],'file'], this code in controllers $docfileload = $model->docname; $model->file = UploadedFile::getinstance($model,'file'); $model->file->saveAs('uploads/'.$docfileload.'.'.$model->file->extension); $model->save(); //save path in db $model->docfile = 'uploads/'.$docfileload.'.'.$model->file->extension; this code in _form <?= $form->field($model,'file')-

error yii2 upload Call to a member function saveAs() on null

被刻印的时光 ゝ 提交于 2020-01-15 10:43:08
问题 I am new programmer world and ask for your help guys, I have error "Call to a member function saveAs() on null" This code in models [['file'],'file'], this code in controllers $docfileload = $model->docname; $model->file = UploadedFile::getinstance($model,'file'); $model->file->saveAs('uploads/'.$docfileload.'.'.$model->file->extension); $model->save(); //save path in db $model->docfile = 'uploads/'.$docfileload.'.'.$model->file->extension; this code in _form <?= $form->field($model,'file')-

Pass variable from link to div

空扰寡人 提交于 2020-01-15 09:26:09
问题 I have a pure css3 modal call by a link, and I wish to pass some variable to the modal. Modal <div id="reasonmodal"> <div class="modal-content"> <div class="header"> Reason </div> <div class="copy"> //content </div> <div class="footer"><a href="?r=Register/UpdateReason&appid=">Close</a></div> <br /> </div> HTML //some other code with foreach appid <a href="#reasonmodal">Click</a> I want pass foreach appid to the modal, any suggestion to do that ? Thanks 回答1: i have an idea (js only): <a href=

how to place yii2 form error in title of anchor tag

拥有回忆 提交于 2020-01-15 03:45:06
问题 how to place yii2 form error in title of anchor tag This is my code $form = ActiveForm::begin([ 'id' => 'login-form', 'options' => ['class' => 'form-horizontal'], 'fieldConfig' => [ 'template' => ' {label} <div class="error-block"> <a href="#" title="{error}">error</a> </div> {input} ', 'errorOptions' => ['tag' => null] ], ]); I want to add error in title of anchor tag in YII2 <a href="#" title="{error}">error</a> 回答1: You need to display the error text inside the anchor tags title attribute,

Yii and Knockout Together? [closed]

霸气de小男生 提交于 2020-01-14 19:50:08
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I am trying to decide on a set of tools to use for a new web app I am going to build. I want it to be really interactive and work

Assign different domain for two controllers only

狂风中的少年 提交于 2020-01-14 18:57:28
问题 I am using the old Yii (v1), and I need to assign a different domain to two controllers only. So I have a bunch of controllers - HomeController.php, CategoryController.php, GuestbookController.php, ShopController.php, ProfileController.php, all of them works with a domain aaaaa.com, but I need that controllers ShopController.php and ProfileController.php would work only with domain bbbbb.com. P.S. When user clicks "My Profile" link or "Shop" the domain changes to bbbbb.com, when user clicks