yii2

yii2 form to send attachment

懵懂的女人 提交于 2019-12-12 05:03:32
问题 I have some form to send a email, but I didn't know how to do it, I'm currently using yii2 here is my form <?php use yii\helpers\Html; use yii\bootstrap\ActiveForm; use yii\captcha\Captcha; use yii\mail\BaseMailer; $this->title = 'Career'; $this->params['breadcrumbs'][] = $this->title; ?> <?php $form = ActiveForm::begin(['id' => 'career-form']); ?> <?= $form->field($model, 'name')->textInput(['autofocus' => true, 'placeholder' => 'Name', 'class' => 'required'])->label(false) ?> <?= $form-

How to use Dependency Injection on Yii2

折月煮酒 提交于 2019-12-12 04:56:36
问题 I am new on Yii2 and I am trying to use Dependency Injection . In my scenario a Pedido can have one Servico and a Servico has many Pedidos. Here is the Pedido class model: <?php namespace app\models; use Yii; /** * This is the model class for table "pedido". * * @property integer $id * @property string $data * @property integer $servico_id * * @property Servico $servico */ class Pedido extends \yii\db\ActiveRecord { public static function tableName() { return 'pedido'; } public function rules

Yii2 - Exception (Invalid Configuration) 'yii\base\InvalidConfigException' with message 'The directory is not writable by the Web process

半城伤御伤魂 提交于 2019-12-12 04:54:49
问题 When I access the site at domain.com/web, I'm displayed this error. I changed the directory permissions and they are listed below. Any solution? PHP User Error – yii\base\ErrorException Exception (Invalid Configuration) 'yii\base\InvalidConfigException' with message 'The directory is not writable by the Web process: /var/www/.../site1/web/assets' in /var/www/.../site1/vendor/yiisoft/yii2/web/AssetManager.php:168 Permissions:- root@...:/var/www/.../site1# ls -l web total 48 drwxrwxr-x 9 root

How sum dynamic fields using wbraganca-yii2-dynamicform?

☆樱花仙子☆ 提交于 2019-12-12 04:49:38
问题 I'm new here. I need help. I use a plugins called "wbraganca / yii2-dynamicform". I have a form that allows the sum of two fields (caja1 and caja2, and the result of the add is "total"). This works. But I have a problem, when I use the " Add rows " button. These fields do not allow addition. Only the first row works but the new ones do not. How can I make it work also dynamically? Thank you. My view. <?php use yii\helpers\Html; use yii\widgets\ActiveForm; use yii\jui\JuiAsset; use yii\web

Yii2 drop down pagination in GridView

不想你离开。 提交于 2019-12-12 04:36:16
问题 I want to make dorpdown pagination in yii2 gridview. I tried this in my GridView, but don't clear what should the next step I do to do. <label> <?= $form->field($model, 'pagesize') ->dropDownList( ["1"=>"1","10"=>"10","25"=>"25","50"=>"50","100"=>"100"], )->label(''); ?>  records per page </label> 回答1: <?= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $model, 'filterSelector' => '#' . Html::getInputId($model, 'pagesize'), 'columns' => [ 'id', 'symbol', 'code', 'name', .

Yii2 model load does not work as expected

六眼飞鱼酱① 提交于 2019-12-12 04:35:54
问题 My question may look like the following question: yii2 - model load function does not set some model attributes However, the case here is different due to dealing with Many to Many relation through junction table. For instance, I have three tables, Jobs , Eqtypes and the junction table Eqtype_jobs . I want to relate some Eqtypes to a current Job using simple activeform using multiple select dropDownList . The following is the code that I have in, the controller and the view: //the controller

Company Follow Button disappear after login popup - Linkedin issue

房东的猫 提交于 2019-12-12 04:34:41
问题 Company Follow Button disappear after login popup - LinkedIn issue This is the code which they have provided to me <script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script> <script type="IN/FollowCompany" data-id="10396143" data-counter="right"></script> Thank you 来源: https://stackoverflow.com/questions/42432608/company-follow-button-disappear-after-login-popup-linkedin-issue

Uploading file in postman extension

你。 提交于 2019-12-12 04:31:14
问题 I try to upload an image via the postman extension, but I get the following response. Furthermore, the image does not appear in the specified directory. { "name": "PHP Notice", "message": "Undefined index: user_id", "code": 8, "type": "yii\\base\\ErrorException", "file": "C:\\xampp\\htdocs\\basic14-4-2016\\controllers\\ApiuploadsController.php", "line": 85, "stack-trace": [ "#0 C:\\xampp\\htdocs\\basic14-4-2016\\controllers\\ApiuploadsController.php(85): yii\\base\\ErrorHandler->handleError(8

Pass calculated data in a texbox not from any model in dynamic form yii2

懵懂的女人 提交于 2019-12-12 04:30:31
问题 I'm trying to get the product of two textboxes (qty, rate) from model productsales to a 3rd textbox (value) withing dynamic form yii2. It is exactly same as Yii2-dynamicforms and javascript, except, the 3rd textbox doesn't belong to any model. _form <div class="col-xs-1 col-sm-1 col-lg-1 nopadding"> <?= $form->field($modelsProductsales, "[{$i}]qty")->label(false)->textInput(['maxlength' => true,'onchange' => 'getTotal($(this))', 'onkeyup' => 'getTotal($(this))','onchange' => 'getValue($(this)

Yii2 add/remove rows in GridView

一曲冷凌霜 提交于 2019-12-12 04:29:11
问题 I am using GridView to list data in my application but today i realized that i need dynamicalli add/remove rows to/from this list. I found some javascript to do this but this is not very elegant. I googled for an extension or module like Karje's GridView extension but ther aren't that much. What do you use for this kind of task or what do you think what is the most simpliest way to make this? I tried unclead/yii2-multiple-input package. It is so great but instead of ActiveForm I need to use