小编lin*_*lin的帖子

Laravel5:如果没有准备好运行命令,如何禁用默认调度程序消息

使用Laravel5调度程序时:

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

如果没有准备好运行命令,我们会收到以下默认输出:

# No scheduled commands are ready to run.
Run Code Online (Sandbox Code Playgroud)

如何禁用此默认Laravel5消息?如果没有准备好运行的命令,我们不希望有输出.当我们能够配置该消息并返回我们自己的代码时,最好的是.

php scheduler laravel-5

8
推荐指数
1
解决办法
226
查看次数

Yii2 cUrl错误请求(#400)

尝试在Yii 2中使用带有Post方法的cUrl时,我收到400错误代码.

Bad Request (#400)
Unable to verify your data submission.
The above error occurred while the Web server was processing your request.

Please contact us if you think this is a server error. Thank you.
Run Code Online (Sandbox Code Playgroud)

这是我的代码,我在其中实例化CurlTool类:

public function actionSend() {
        $model = new \app\models\Licitatie;
        if ($model->load(Yii::$app->request->post())) {
            $curl_tool = new \common\components\CurlTool();
            $result = $curl_tool->fetchContent('http://www.william.ro/licitatia_bursa/frontend/web/index.php/organizator/licitatie/evrika', $model->attributes);
            print_r($result);
        }
    }

    public function actionEvrika() {
        return json_encode(
                array(
                    'a' => 'b',
                )
        );
    }
Run Code Online (Sandbox Code Playgroud)

这是curltool类代码:

<?php

namespace common\components;

class CurlTool {

    public …
Run Code Online (Sandbox Code Playgroud)

php curl yii2

7
推荐指数
1
解决办法
1万
查看次数

如何检测我的应用程序是否在Ripple Emulator上运行?

有没有办法检测我的应用程序当前是在Ripple Emulator上运行,而不是真正的设备?我想要一些解决方法代码只能在模拟器上运行.

emulation hybrid ripple cordova

7
推荐指数
2
解决办法
1382
查看次数

ngAnimate停止在AngularJS 1.6.4中工作

我有一个简单的应用程序,其中有一个简单的css动画,就像AngularJS 1.2.2+中的魅力一样ngAnimate 1.2.2:

- > Runnable demo就像魅力一样.

因为(也许)没有理由相同的代码不适用于AngularJS 1.6.4+ ngAnimate 1.6.4:

- > 破碎的动画演示

css没有添加动画类.控制台中没有错误.我不知道这里有什么不对.请注意,这$scope.pictures是虚拟数据.

视图

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-animate.min.js"></script>
        <link rel="stylesheet" href="./style.css">
        <script src="app.js"></script> 
        <title></title>
    </head>
    <body ng-app="portfolio">
        <div class="gallery" ng-controller="galleryController">
          <div class="appear" ng-repeat="picture in pictures"></div>
        </div>
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

AngularJS应用程序

/*global angular, console*/
var app = angular.module('portfolio', ['ngAnimate']);
(function() {
  "use strict";
  /* Gallery Controller */
  app.controller('galleryController', function(
      $scope
    ) {
      $scope.pictures …
Run Code Online (Sandbox Code Playgroud)

javascript css angularjs ng-animate

7
推荐指数
1
解决办法
389
查看次数

如何将数组作为Yii2 gridview列的参数传递

我试图$arr_judete_v2作为一个参数传递给gridview中的回调函数,它不起作用;

$model['county_id'] 返回一个数字

$arr_judete_v2[1]['nume'] 返回一个名字

我的问题:

[
                    'attribute' => 'county_id',
                    'label' => Yii::t('diverse', 'Judet'),
                    'content' => function($model, $arr_judete_v2) {
                        return $arr_judete_v2[$model['county_id']]['nume'];
                    },
                ],
Run Code Online (Sandbox Code Playgroud)

整个gridview

<?php
    echo GridView::widget([
        'layout' => "{items}",
        'dataProvider' => $dataProvider,
        'columns' => [
            'id',
            [
                'attribute' => 'nume',
                'label' => Yii::t('companie', 'nume'),
            ],
            'cui',
            'email',
            [
                'attribute' => 'county_id',
                'label' => Yii::t('diverse', 'Judet'),
                'content' => function($model, $arr_judete_v2) {
                    return $arr_judete_v2[$model['county_id']]['nume'];
                },
            ],
            [
                'class' => 'yii\grid\ActionColumn',
                'template' => '{update} {delete}',
                'buttons' => [
                    'update' => …
Run Code Online (Sandbox Code Playgroud)

php yii yii2

6
推荐指数
1
解决办法
1万
查看次数

Yii2:在ActiveRecord的with()中使用实现范围

在Yii1中,我可以这样做:

$posts=Post::model()->with(array(
    'comments'=>array(
        'scopes'=>array('recently','approved')
    ),
))->findAll();
Run Code Online (Sandbox Code Playgroud)

有没有办法在Yii2中的with()的回调函数中调用关系的范围?

Customer::find()->with([
    'orders' => function ($query) {
        $query->andWhere('status = 1');
    },
    'country',
])->all();
Run Code Online (Sandbox Code Playgroud)

php activerecord scope yii2

6
推荐指数
1
解决办法
3940
查看次数

在 Laravel POST 请求上重定向 302

我正在开发一个Laravel Web Service. 当我POST使用 Web 表单尝试路由时,一切正常,但是当我使用 REST 客户端尝试相同时,Postman它没有得到我应该的响应。

它给了我状态代码302,并重定向到“/”。有什么问题?

php api laravel

6
推荐指数
2
解决办法
2万
查看次数

使复选框成为必需的AngularJS

我有一个表单,用户必须通过复选框回答问题.复选框很少,我在表单中使用AngularJS来验证它.基本验证是填写所有必填字段.

以下是我的示例代码:

<input type="checkbox" name="skills"> IT
<input type="checkbox" name="skills"> Design
<input type="checkbox" name="skills"> Photoshop
<input type="checkbox" name="skills"> Writing
Run Code Online (Sandbox Code Playgroud)

现在我想要复选框是必需的,所以从"技能"复选框,用户至少检查1框.

我已经尝试过贴required标签,但似乎没有用.

我正在使用AngularJS来验证我的表单

<button ng-disabled="myForm.$invalid">Submit</button>
Run Code Online (Sandbox Code Playgroud)

知道如何解决这个问题吗?如果你可以工作小提琴那么棒.

html javascript checkbox angularjs

6
推荐指数
1
解决办法
3842
查看次数

如何在AngularJS中获取文件内容和其他详细信息

单击提交按钮时如何获取文件内容。我只得到第一和第二输入。请参考摘要:

!DOCTYPE html>
<html lang="en">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<body>

<div ng-app="myApp" ng-controller="formCtrl">
  <form novalidate>
    First Name:<br>
    <input type="text" ng-model="user.firstName"><br>
    Last Name:<br>
    <input type="text" ng-model="user.lastName">
    <input type="file" ng-model="user.file">
    <br><br>
    <button ng-click="reset()">Submit</button>
  </form>
  <p>form = {{user}}</p>
  <p>master = {{master}}</p>
</div>
  <script>
var app = angular.module('myApp', []);
app.controller('formCtrl', function($scope) {
   $scope.reset = function(){
   console.log($scope.user)
   }
   
});
</script>

</body>
</html>
Run Code Online (Sandbox Code Playgroud)

javascript angularjs angularjs-forms angularjs-fileupload

6
推荐指数
2
解决办法
2万
查看次数

AngularJS:如何翻译md占位符?

我有一个使用AngularJS的非常简单的datepicker,我想给它一个占位符,以便使用AngularJS转换它(就像我通常在我的项目中一样)。

这是我的HTML代码:

<div flex class="layout-row">
        <md-datepicker ng-model="vm.calendarEvent.start" ng-model-options="{ timezone: 'UTC' }" md-placeholder="Une date" translate translate-md-placeholder="PROF.SHARE.DUE">
        </md-datepicker>
</div>
Run Code Online (Sandbox Code Playgroud)

这样做会引发此错误:

错误:[$ compile:multidir]多个指令[mdDatepicker(模块:material.components.datepicker),翻译(模块:pascalprecht.translate)]要求以下新/隔离范围:

<md-datepicker class =“ ng-pristine ng-untouched ng-valid _md-datepicker-has-triangle-icon” ng-model =“ vm.calendarEvent.start” ng-model-options =“ {时区:'UTC' }“ md-placeholder =”使用日期“ translation =”“ translate-md-placeholder =” PROF.SHARE.DUE“>

javascript datepicker angularjs angular-translate

6
推荐指数
1
解决办法
578
查看次数