小编Deb*_*Deb的帖子

尝试访问类型为 int { DefaultValueBinder.php line 82 } 的值的数组偏移量

我有一个导出到 excel 的按钮,可以下载 excel 文件。但是,当我单击它时,它会显示错误为“尝试访问 int 类型值上的数组偏移量”

我的代码是这样的:

public static function dataTypeForValue($pValue = null)
    {
        // Match the value against a few data types
        if ($pValue === null) {
            return PHPExcel_Cell_DataType::TYPE_NULL;
        } elseif ($pValue === '') {
            return PHPExcel_Cell_DataType::TYPE_STRING;
        } elseif ($pValue instanceof PHPExcel_RichText) {
            return PHPExcel_Cell_DataType::TYPE_INLINE;
  } elseif ($pValue[0] === '=' && strlen($pValue) > 1) {   //error comes in this line
            return PHPExcel_Cell_DataType::TYPE_FORMULA;
        } elseif (is_bool($pValue)) {
            return PHPExcel_Cell_DataType::TYPE_BOOL;
        } elseif (is_float($pValue) || is_int($pValue)) {
            return PHPExcel_Cell_DataType::TYPE_NUMERIC;
        } …
Run Code Online (Sandbox Code Playgroud)

php excel export-to-excel laravel

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

将引导框的确定取消选项更改为是和否

谁能告诉我应该如何将 Bootbox的ok&cancel选项更改为yes& no

function deletelaw(id) {
  bootbox.confirm('Are you sure you want to delete?', function(result) {
    if (result) {
      $("#deletelaw_" + id).hide();
      $(".law1_" + id).prop("checked", false);
      var splits = $("#laws_assigned1").val().split(",");

      var finalSplit = [];
      for (var i = 0; i < splits.length; i++) {
        if (id != splits[i]) {
          finalSplit.push(splits[i]);
        }
      }
      $("#laws_assigned1").val(finalSplit.join());
    }
  });
}
Run Code Online (Sandbox Code Playgroud)

javascript jquery laravel bootbox

2
推荐指数
1
解决办法
1064
查看次数

标签 统计

laravel ×2

bootbox ×1

excel ×1

export-to-excel ×1

javascript ×1

jquery ×1

php ×1