草庐IT

settings.bundle

全部标签

php - Symfony2 - 生成 :bundle is not defined

我想生成一个新包,但它说命令generate:bundle未定义。当我尝试这个命令时:phpapp/consolelist--raw生成:未显示捆绑...命令输出:helpDisplayshelpforacommandlistListscommandsassetic:dumpDumpsallassetstothefilesystemassets:installInstallsbundleswebassetsunderapublicwebdirectorycache:clearClearsthecachecache:warmupWarmsupanemptycacheconfig:dump

php - 在 Symfony 2 中的简单 bundle 类中使用容器

我在Symfony2的包中创建了一个简单的类:classMyTest{publicfunctionmyFunction(){$logger=$this->get('logger');$logger->err('testingout');}}如何访问容器? 最佳答案 您需要注入(inject)服务容器。你的类(class)将是这样的:useSymfony\Component\DependencyInjection\ContainerInterface;classMyTest{private$container;publicfuncti

php - 如何替换 Jms Payment Paypal Bundle 中的文本

我在JMSCorePayment(symfony2)中使用了paypalbundle。但是,在结帐时我有文字:Datapaypalexpresscheckout我已经在站点范围内搜索了这个,但在任何地方都找不到这个文本。Google上也没有答案!有人知道如何翻译甚至删除它吗? 最佳答案 您可以使用以下代码隐藏它:{{form_row(form.data_paypal_express_checkout,{'label':'','label_attr':{'class':'hide'}})}}并使用此翻译键添加自己的消息:form.la

php - 我应该使用 set_value() 来重新填充 CodeIgniter 中的表单吗

我的问题是我是否应该使用set_value()来重新填充表单。这么说似乎很奇怪,但我正在创建一个共享Controller功能和View,可用于添加新记录或编辑现有记录。这样做似乎很有意义,因为功能非常相似。因此,如果我们调用现有记录进行编辑,我会这样做:$data['fields']=$this->customer_model->get_customer($id);如果提交表单以保存记录,或者如果我们是第一次添加记录,则如果用户出错,表单有可能重新加载,所以我填充$data['fields']这个方式代替:$data['fields']=array('company'=>$this->

php - 拉维尔 : Overriding a Bundle's Service Providers

我有一个项目使用Laravel的Sentinel包。前一段时间,我问了一个关于extendingamodelprovidedinthebundle的问题.我接受的答案有效,但它需要在供应商文件夹中编辑bundle的代码。从那时起,我运行了一个composerupdate命令,我应用的更改被覆盖了(这并不奇怪)。我现在对laravel的工作原理有了更多的了解,所以我能够追溯到我的应用程序引用bundle服务的终点。在我的config/app.php文件中,我有服务提供商引用:'Sentinel\SentinelServiceProvider',SentinelServiceProvide

php - set_value 不适用于 Codeigniter 上的输入类型文件

我正在为我的项目使用HMVCCodeigniter模式。在我的项目中,我需要在输入字段类型为文件的表单上设置值。所以,我很感谢帮助我解决这个问题的他们。我的Controller是test.phpload->library('form_validation');$this->load->helper('url');$this->form_validation->set_rules('fname','FirstName','required|trim');$this->form_validation->set_rules('mname','MiddleName','required|tri

php - 安装 symfony 包(Doctrine CouchDB Bundle)

我希望将这个包安装到我的symfony项目中。但是,我遇到了一些问题。如果答案微不足道,请接受我的无知,但我已尝试寻找解决方案,但遗憾的是,我一无所获。在我的deps文件中,我有:[doctrine-couchdb]git=http://github.com/doctrine/couchdb-odm.git[DoctrineCouchDBBundle]git=http://github.com/doctrine/DoctrineCouchDBBundle.gittarget=/bundles/Symfony/Bundle/DoctrineCouchDBBundle我运行bin/vend

PHP memory_get_peak_usage 和 ini_set ('memory_limit' , '-1' )

我最近遇到了内存分配问题,所以我开始尝试使用ini_set('memory_limit',value);指令,尝试以增量方式输入值。现在,通过网络(和SO)搜索我发现我可以将-1作为value。所以,我做到了,现在脚本完全运行到最后没有中断(在我以前得到内存分配错误之前)。然而,我不明白的是,脚本文件末尾的这两行:$mem=memory_get_peak_usage(true);echo"Peakmem.usage:".round($mem/1024/10124,2)."MB";产生大约10.8MB,当我查看/var/log/messages时,我可以看到这一行:Nov2113:52:

php - 没有 FOS bundle 的 Symfony 密码重置

我正在尝试制作一个用户可以轻松更改密码的表单。我希望我的逻辑是正确的,但是我收到如下错误;Expectedargumentoftype"string","AppBundle\Form\ChangePasswordType"given这是我的Controller;publicfunctionchangePasswdAction(Request$request){$changePasswordModel=newChangePassword();$form=$this->createForm(newChangePasswordType(),$changePasswordModel);$for

PHP Doctrine : how to set refClass extra columns?

我有以下架构User:columns:id:type:integerprimary:truename:stringrelations:UserGroup:local:userGroup_idforeign:idrefClass:User2GroupUserGroup:columns:id:type:integerprimary:truename:stringrelations:User:local:user_idforeign:idrefClass:User2GroupUser2Group:columns:user_id:type:integerprimary:trueuserGrou