草庐IT

Created_At

全部标签

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 - FOSUser Bundle The child node "db_driver"at path "fos_user"必须配置

我正在尝试在安装FOSUserBundle2.0后更新原则架构,但我一直收到此错误:InArrayNode.phpline238:Thechildnode"db_driver"atpath"fos_user"mustbeconfigured.文件config.yaml在位置/config/config.yaml中正确配置:framework:translator:~fos_user:db_driver:ormfirewall_name:mainuser_class:Entity\Userfrom_email:address:"%mailer_user%"sender_name:"%ma

php - Laravel Eloquent Not Created_At 今天

好吧,所以我正在尝试进行查询,其中不是created_at的用户这一天被选中,我遇到了一点麻烦。我尝试过的所有内容仍然被选中。这是我尝试过的一些东西(没有成功):$users=User::where('created_at','!=',date('Y-m-dH:i:s'))->get()$users=User::where('created_at','!=',newDateTime())->get()$users=User::where('created_at','!=',date('Y-m-d'))->get()$users=User::where('created_at','!='

php - XML 解析错误 : XML or text declaration not at start of entity in php

您好,我正在用php生成一个xml文件,但出现错误XML解析错误:XML或文本声明不在实体的开头我的代码是---formatOutput=true;$id=(int)$_GET['imageid'];$query="select*fromtbl_image_gallerywhereimageId='$id'ORDERBYgallIdDESC";$select=mysql_query($query);$content=$dom->appendChild($dom->createElement('content'));while($res=mysql_fetch_array($select

php - 反序列化()[函数。反序列化] : Error at offset 49151 of 49151 bytes

在将对象存储到数据库中而不是检索它之后,我像网站上的许多人一样出现了偏移错误。如果我不存储它一切正常:$serializedObject=serialize($this);$unSerializedObject=unserialize($serializedObject);此外,我在保存数据和从数据库中检索数据时使用base64编码,但这无济于事。我没有做任何逃避。我的对象处理一些字符串。我发现这个字符串:Awomanistravellingaroundtheworld.Sheis28yearsoldandsheisfromGreatBritain.Shecannotuseacaror

php - Laravel,仅按日期过滤时间戳

我想按用户ID和created_at字段过滤表。唯一的东西是created_at是一个时间戳,我只想按日期查询而不是时间。所以有点像-$messages=Message::where(['from'=>$fromUser->id,'created_at'=>'TODAY'SDATE'])->get(); 最佳答案 $query->whereDate('created_at','=',date('Y-m-d'));或$query->whereDate('created_at','=',Carbon::today()->toDateSt

php - 在我删除 softDelete 后,Laravel 仍然希望找到 deleted_at 列

我刚刚通过此迁移从表中删除了softDelete:Schema::table("items",function($table){$table->dropSoftDeletes();});但现在每个查询的结果都是:Columnnotfound:1054Unknowncolumn'items.deleted_at'in'whereclause'代码没有明确引用此列。它是否被缓存在某个地方,如果是,如何清除它? 最佳答案 您还需要从模型中删除特征:useSoftDeletes;来自thedocs:Toenablesoftdeletesfo

php - CodeIgniter 事件记录 : Load One Row at a Time

文档中描述的普通result()方法似乎会立即加载所有记录。我的应用程序需要加载大约30,000行,并且一次一个,将它们提交给第三方搜索索引API。显然,一次将所有内容加载到内存中效果不佳(由于内存太多而出错)。所以我的问题是,如何才能达到传统MySQLiAPI方法的效果,在这种方法中,您在循环中一次加载一行? 最佳答案 这是您可以做的事情。while($row=$result->_fetch_object()){$data=array('id'=>$row->id'some_value'=>$row->some_field_nam

php - Symfony2 : new instance at each service call instead of using the same

我创建了一个服务,但每次调用它时,它都会创建一个新实例,而不是使用同一个实例。这是我的services.yml:my.sessiondata:class:My\Bundle\Service\SessionDatacalls:-[setServices,[@security.context,@service_container,@session,@doctrine.orm.entity_manager]]scope:container还有我的服务:namespaceMy\Bundle\Service;classSessionData{protected$company;publicfun

php - 如何在(时间),在 laravel 4 中发布

我在Laravel4中制作我的网站,我在表中有created_at和updated_at字段。我想制作一个新闻系统,告诉我自发布帖子以来已经过去了多少时间。|name|text|created_at|updated_at||__________|__________|________________________|___________________||newsname|news_text|2013-06-1211:53:25|2013-06-1211:53:25|我想展示类似的东西:-created5minutesago-created5monthsago如果帖子超过1个月-cr