草庐IT

current_item

全部标签

php - 为什么我在使用 $item->get_permalink() 时会在 SimplePie 中发生内存泄漏?

我正在使用SimplePie使用PHP5.3(启用gc)来解析我的RSS提要。这在执行以下操作时效果很好并且没有问题:$simplePie=newSimplePie();$simplePie->set_feed_url($rssURL);$simplePie->enable_cache(false);$simplePie->set_max_checked_feeds(10);$simplePie->set_item_limit(0);$simplePie->init();$simplePie->handle_content_type();foreach($simplePie->get_

php - rbac Yii2 中 auth_item 表中的类型是什么

我一直在尝试在Yii2GUide之后设置rbacDbManager.因此,我使用migrate命令在数据库中创建表作为他们的指令。我发现创建的表很少。现在我的问题是表auth_item中有列type。我不明白为什么要用它? 最佳答案 它只是授权项类型:Thetypeoftheitem.ThisshouldbeeitherTYPE_ROLEorTYPE_PERMISSION.阅读更多:http://www.yiiframework.com/doc-2.0/yii-rbac-item.html

PHP Twig : access current template variable from within macro without passing?

是否可以从宏中访问当前模板的变量而不直接将变量传递给宏?谢谢。 最佳答案 可以将所有上下文变量传递给宏:{{macro(_context)}}_context是specialvariable,其中包含所有当前定义的变量(按名称=>值)。 关于PHPTwig:accesscurrenttemplatevariablefromwithinmacrowithoutpassing?,我们在StackOverflow上找到一个类似的问题: https://stackov

php - Magento Quote Item 对象 - 如何加载项目的选项?

虽然我知道我可以只加载QuoteItemOptions集合并按item_id过滤它,但我无法确定Magento人员没有添加任何_afterLoad或_loadOptions方法可以轻松地将选项分配给项目,因为已经有_options、_optionsByCode属性...提供一些我在做什么的例子://updated(forgottoactuallyloadobject$item=Mage::getModel('sales/quote_item')->load($itemId);$buyRequest=$item->getBuyRequest();//almostempty,onlyqty

php - Symfony Knp 菜单包 : set active a menu item even when its not on that menu

我创建了我的菜单生成器并且它有效。我的路线之一是/database但这有一个子路由:database/view/{id}我不想将View路由放入菜单项中,因为没有ID它就无法工作。但我希望当用户在View中时数据库路由处于事件状态。我该怎么做? 最佳答案 设法用这个小技巧解决了它:在添加所有子项之后但在返回我添加的菜单之前的menuBuider中$request=$this->container->get('request');$routeName=$request->get('_route');switch($routeName)

php - Magento - 向 sales_flat_quote_item 和 sales_flat_order_item 添加新列

我正在使用Magento版本1.4.1.1,我想在sales_flat_quote_item表中保存一个值(并将其传递给sales_flat_order_item)。我找到了thistutorial,但我不确定它是否仍然相关(对于Magento版本1.4.1.1),因为它讨论了一个名为sales_order的表,我相信它现在是sales_flat_order并且看起来有点不同。这个方法还有效吗?如果是这样-我可以将它用于sales_flat_quote_item和sales_flat_order_item以及我应该在推荐中放入什么entity_type_id:`insertintoea

PHP 的 current() 和 key() 函数;与函数签名不一致

我注意到PHP的current()和key()数组函数(像其他数组指针函数)通过引用获取数组参数:mixedcurrent(array&$array)Everyarrayhasaninternalpointertoits"current"element,whichisinitializedtothefirstelementinsertedintothearray.经过几次快速检查,似乎current()和key()(不像其他数组指针函数)都接受按值传递数组参数,从而在传递函数的返回值时不会抛出错误。我得出的结论是,这仅仅是因为current()和key()没有尝试移动数组指针,因此不需

php - 复制演示 "You cannot define a sequence item when in a mapping"时出错

我在尝试重现Symfony提供的演示时遇到错误。你可以在这里找到它。http://symfony.com/doc/current/book/forms.html#book-form-creating-form-classes当我将表单包含在Controller中时,我可以使表单正常工作,但是当我将表单作为自己的类时,我最终会收到一条错误消息。Youcannotdefineasequenceitemwheninamapping500InternalServerError-ParseException日志返回:CRITICAL-UncaughtPHPExceptionSymfony\Com

php - 从扩展模板调用时的 $smarty.current_dir 值

我的代码如下:内容.tpl:{*Smarty*}{extendsfile='PageContentLayout.tpl'}PageContentLayout.tpl{*Smarty*}{blockname="file_name"}{$smarty.current_dir}{$smarty.template}{/block}{blockname="other_content"}...{*blah...*}...{/block}在smarty的早期版本中,此代码将打印文件的模板名称和路径:content.tpl。不过我刚升级到3.1.29,现在打印的好像是基础文件PageContentLa

php - 未创建 Magento 订单创建 sales_flat_quote_item

我有一个模块可以从另一个站点获取提要,然后将订单导入magento。问题是,尽管订单已正确创建并在Magento中显示出来,但它们并未显示在“已订购产品”报告中。原因似乎是此报告查看sales_flat_quote_item表以生成其结果,但没有我的销售项目的条目。但是,它们确实正确显示在sales_flat_order_item中。以下是代码的简化版本。关于为什么我没有在flat_quote_item中获得条目有什么建议吗?为什么OrderedProducts报告使用的Magento模型使用报价表而不是订单表?$quote=Mage::getModel('sales/quote')-