草庐IT

table_exists

全部标签

php - 奏鸣曲管理员 - sonata_type_collection : select from the list of existing entities

我正在尝试使用PageHasImage桥接实体在Page和Image实体之间实现多对多关系。在PageAdmin中,我添加了如下字段:->add('galleryImages','sonata_type_collection',array('cascade_validation'=>false,'by_reference'=>false,'type_options'=>array('delete'=>false)),array('edit'=>'inline','inline'=>'table','sortable'=>'position','admin_code'=>'sonata.

php - 银条 3 : the method 'fortemplate' does not exist on 'File'

我正在为我的页面创建一个GridField,它与我的DataObjects有一个has_many关系,但是在添加数据并保存对象后它会中断CMS中的页面。搜索后我无法弄清楚原因或找不到任何答案。这是错误和我的代码:[UserError]UncaughtException:Object->__call():themethod'fortemplate'doesnotexiston'File'ProductPage.phpclassProductPageextendsPage{//Contactobject'sfieldspublicstatic$db=array('ProductPrice'

php - Laravel 5 SQLSTATE[42S02] : Base table or view not found

我正在研究Laravel中的存储库设计模式,我正在使用https://github.com/andersao/l5-repository去做。我想我在我的项目中安装成功了。但是当我使用存储库运行代码时,我遇到了一些问题SQLSTATE[42S02]:Basetableorviewnotfound:1146Table'test.nhanviens'doesn'texist(SQL:select*fromnhanviens)我数据库中的表是Nhanvien而不是Nhanviens在我的代码中NhanvienRepository.phpNhanvienRepositoryEloquent.p

php - 拉维尔 4 : Will a soft delete on a table also apply to it relationships

我有一个名为'Titles'的表,我将向它添加软删除,但它还有几个引用此'Titles'表的其他表:目前,如果我删除一个标题,它将在标题详细信息处自动从所有其他引用的表格中删除。因此,如果我在执行删除时向'Titles'表添加软删除,它会在'titles'表上执行软删除,但会从引用表中删除详细信息?或者它会忽略onDeleteCascade请求并保留引用的数据吗?如果是第一个选项,那么我需要添加一个$table->softDeletes();到所有表引用。以及将protected$softDelete=true;添加到他们的模型中? 最佳答案

php - Symfony2 : The option "widget" does not exist

我正在尝试使用symfony2构建表单,但每当我添加小部件选项以指定表单字段类型时,我总是收到错误消息“选项“小部件”不存在”。我正在按照那里的文档给出的示例http://symfony.com/doc/current/book/forms.html我的代码不起作用。classUserTypeextendsAbstractType{publicfunctionbuildForm(FormBuilder$builder,array$options){$builder->add('Name')->add('Login')->add('Password')//,'text',array('w

php - mock & PHPUnit : method does not exist on this mock object

你能告诉我问题出在哪里吗?我有一个包含以下测试的GeneratorTest.php文件:shouldReceive('put')->with('foo.txt','foobar')->once();$generator=newGenerator($fileMock);$generator->fire();}publicfunctiontestGeneratorDoesNotOverwriteFile(){$fileMock=\Mockery::mock('\stats\jway\File');$fileMock->shouldReceive('exists')->once()->and

php - "Unable to find xref table"与 Dompdf0.6a + FPDI

我正在尝试使用dompdf0.6a从html生成一个pdf文件并且工作正常,但随后我需要对其进行加密以进行保护,但出现错误FPDFerror:Unabletofindxreftable-MaybeaProblemwith'auto_detect_line_endings'但是,如果我使用旧的dompdf版本,它工作正常。我猜它会生成fpdi不支持的更新的pdf版本。顺便说一句。我将其追踪到FPDI/pdf_parser.php:208(内部方法pdf_read_xref()) 最佳答案 我能够通过使用Adob​​eAcrobatPr

php - 与 Symfony2 AsseticBundle 和 'non existing routes' 冲突

Assetic不适用于此标签:{%stylesheetsoutput='/style/app.css''@VendorBundle/Resources/style/main.css'%}{%endstylesheets%}如果我使用它,就像Assetic不知道如何处理它一样。在config_devuse_controller中为真。我找不到我做错了什么。我刚明白:Anexceptionhasbeenthrownduringtherenderingofatemplate("UnabletogenerateaURLforthenamedroute"_assetic_aca6c7a_0"as

php - 打开购物车 2 : Add currently logged admin id to oc_product table on product insert

我想监控哪个仪表板用户(“管理员”)向数据库添加了新产品。我考虑的解决方案是在admin>model>catalog>product.tpl下添加另一个insert函数addProduct(),它将用户ID添加到之前在oc_product下添加的自定义列。$userID=//currentlyloggedinpublicfunctionaddProduct($data){$this->event->trigger('pre.admin.product.add',$data);$this->db->query("INSERTINTO".DB_PREFIX."productSETadded

php - "Request does not exist"创建表单 symfony2

我是php和symfony2的菜鸟。我正尝试按照教程http://symfony.com/doc/current/book/forms.html创建一个表单和其他一些教程。我收到“500内部错误”,我不知道我什么时候失败了,我正在伤脑筋。需要帮助,请日志:[2015-10-1623:35:27]request.INFO:Matchedroute"nueva_serie".{"route_parameters":{"_controller":"Acme\\AxialBundle\\Controller\\SeriesController::nuevaAction","_route":"n