草庐IT

undefine

全部标签

php - Cpdf.php 行 3855 : Undefined index: at barryvdh/laravel-dompdf 中的 ErrorException

我使用的是laravel5.2,dompdf在本地主机上运行良好,但是当移动到AWS时,它一直显示ErrorExceptioninCpdf.phpline3855:Undefinedindex:,在这一行(3855)中有字体变量。示例代码:$html="Hello";PDF::setOptions(['dpi'=>150,'defaultFont'=>'sans-serif']);$pdf=PDF::loadHTML($html)->setPaper('a4','landscape');return$pdf->download('pdfview.pdf');由于barryvdh/lar

php - undefined variable 。拉维

我正在尝试过滤我的结果。为此,我有以下查询:$destinations=$request['destinations'];if($request->has('destinations')){$trips=Trip::where('status','=',1)->whereHas('destinations',function($q){$q->where('destinationsid','=',$destinations);})->get();}else{echo"Nodestinationprovided";}但是我得到了undefinedvariable$destinations。

php - undefined variable 当值为空时

我有2个代码块....//第一个区block$val){echo$name.":".$val[0].",".$val[1].",".$val[2];}}unset($new_array);?>第二block$val){echo$name.":".$val[0].",".$val[1].",".$val[2];}}unset($new_array);?>第一block或第二block将在一天内给出空结果。意味着如果今天,第一个block将给出空结果,明天第二个block将给出空结果......或者......问题:今天,第二个block的值是空的,它给出了通知:undefinedvari

php - 引用数组键时为 "Undefined index"

我在index.php中有一个表单';echo'echo?>这里$row['act_name']是从数据库中获取的值。我的update_act.php文件是但我收到错误Undefinedindex:$row['act_name']inC:\wamp\www\ps\activity\update_act.php。我想为不同的submits使用不同的名称,但我无法在另一个页面中获取它的值。有什么办法吗? 最佳答案 我不完全知道你想做什么,但是如果变量$row['act_name']的值在两种情况下(表单页面和更新脚本)都相同,那么你可以

PHP 不会对 undefined variable 发出警告

如有错误请指正。据我所知,PHP应该对此发出警告,但实际上没有。我正在使用PHP5.2.17。我怎样才能解决这个问题?我假设这是在php.ini中的某处设置的? 最佳答案 查看errorreporting的文档.我相信如果您启用E_NOTICE,您会看到针对undefinedvariable的警告。您可以阅读所有错误报告常量here. 关于PHP不会对undefinedvariable发出警告,我们在StackOverflow上找到一个类似的问题: https

PHP: "Call to undefined method"... 但方法已定义?

我有一个Database.php类,它是一个抽象的Singleton类:其他数据库扩展了这个类并实现了抽象函数,这样我就可以改变我使用的数据库,同时确保我的应用程序仍然可以工作,只要它使用这个抽象层中的函数(我已经省略了函数定义来自上面的代码)。我在PDO.php中有一个PDO类。它扩展了数据库,还包括与上面相同的instance()函数,但它没有自己的$_instance变量。classPDOextendsDatabase{//...publicstaticfunctioninstance(){$class=get_called_class();if(!self::$_instanc

php - 为什么我在 Laravel View 中得到 "Undefined variable"?

当我尝试从类别所在的表中获取数据时,出现undefinedvariable:类别错误。$posts变量工作正常。@if(count($posts))@foreach($postsas$post)@if($post->category)category->name}}isotope-item">{{$post->updated_at}}{{Str::words($post->title,3)}}{{Str::words($post->body,60)}}{{HTML::linkRoute('posts.show','Readmore',array($post->id))}}@endif@

php - codeigniter 上的错误 undefined variable 替代

我在我的View文件中发现了这种错误类型,如下所示。请帮我解决这个错误。我很高兴能解决这个问题。我在等待正确答案遇到PHP错误严重性:通知消息:undefinedvariable:备选文件名:views/all_investor_relation.php行号:47$value){$paths=base_url().'uploads/investor_relation/';$image=$value['docpath'];$title=$value['title'];$imageso="$title";$content="".$i."".$imageso."}echo$content;}

javascript - 选择 2 类型错误 : b is undefined

我正在使用select2在下拉列表中显示ajax结果,但是当我将数据附加到select2时,它显示错误TypeError:bisundefinedJS代码varbaseurl=$("#baseurl").val();$(".myselect").select2({placeholder:"Selectainspector",allowClear:true,ajax:{url:baseurl+'/admin/getdata',dataType:'json',type:"GET",quietMillis:50,data:function(term){return{term:term.ter

php - Laravel undefined variable $articles

我正忙于我自己的新闻系统,我正在使用Laravel5。我对Laravel很陌生,并且使用教程来逐步了解它。现在我遇到了这个错误“undefinedvariable:文章”。这是我的ArticlesController.php这是我的news.blade.php@foreach($articlesas$article){{$article->title}}5December JohnDoe Category,Category 5Comments{{$article->body}}ReadMore@endforeach我已经尝试了一些事情,例如删除所有内容并重