草庐IT

razor-declarative-helpers

全部标签

PHP 面向对象 : Get all declared classes which are have extended another parent class

我需要获取所有扩展了另一个父类的声明类。例如……classParentClass{}classChildOneextendsParentClass{}classChildTwoextendsParentClass{}classChildThree{}我需要一个输出这个的数组:array('ChildOne','ChildTwo')我是PHPOOP的新手,但基于一些谷歌搜索,我想到了这个解决方案。$classes=array();foreach(get_declared_classes()as$class){if(is_subclass_of($class,'ParentClass'))

PHP7 : Methods with a scalar type declaration refuse to type juggle NULL values, 即使在弱/强制模式下

截至PHP7.0,标量类型提示int、float、string和bool可以包含在方法签名中。默认情况下,这些类型声明以弱/强制模式(或“typejuggling”模式)运行。根据PHPmanual:PHPwillcoercevaluesofthewrongtypeintotheexpectedscalartypeifpossible.Forexample,afunctionthatisgivenanintegerforaparameterthatexpectsastringwillgetavariableoftypestring.但即使可以将NULL强制转换为整数0,具有int类型提

php - 拉维尔 5 : Installing ide helper for Netbeans

我正在尝试实现Laravelidehelper:barryvdh/laravel-ide-helper。尝试下载要点,将它放在我项目的根文件夹中,但它没有用。还尝试使用composer安装它并在config/app.php文件中添加Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class。即使我重新启动netbeans,这两种方法都不起作用。使用Ubuntu和Laravel5.1.20有人知道我做错了什么吗? 最佳答案 用composer安装它是不够的,你还必须用这个命令生成

PHP: "Declaration of ... should be compatible with that of ..."

我想为可CRUD(可以保存和删除)的实体创建一个接口(interface)。这是我的抽象类:abstractclassAbstractCrudableEntityextendsAbstractEntity{abstractpublicfunctiondoSave();abstractpublicfunctiondoDelete();}我的实现类需要这些方法的几个额外参数。这是实现类的签名:classContactextendsAbstractCrudableEntity{publicfunctiondoSave(User$user,\UberClientManager$manager)

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

我的rss.php中有这个错误XMLParsingError:XMLortextdeclarationnotatstartofentityLocation:http://blah.com/blah/blah/site/rss.phpLineNumber1,Column3:andthisisshownunderneaththeerrorxzfbcbcxv123Descriptionfortherssfeed----------------^显示在页面左侧和?xml行之间。在我的rss.php中有';?>';?>';$sql="SELECT*FROM$_NEWS_TABLELIMIT5";

php - Magento : Fatal error: Class 'Mage_Giftcards_Helper_Data' not found in . ..../app/Mage.php 第 546 行

我安装了一个模块扩展,它在管理员中抛出一个fatalerror“fatalerror:类‘Mage_Giftcards_Helper_Data’在..../app/Mage.php中找不到,第546行”。我已提交此链接https://stackoverflow.com/a/9191286/2919940还有这个链接https://magento.stackexchange.com/a/7133/3693但是我有Webtex_Giftcards_Helper在我的config.xml中,我有这个类classWebtex_Giftcards_Helper_DataextendsMage_C

php - View Helper 中的 Zend Framework 2 服务

我需要编写一个View助手来获取服务并使用它做一些事情。我成功地实现了View助手以访问服务定位器。问题是在调用__invoke方法时,没有通过服务定位器找到我想要获取的服务。查看助手代码:getServiceLocator());return$model->getCurrent();}}模型代码片段:namespaceApplication\Model;useApplication\Entity,Andreatta\Model\BaseasBase;classCustomerextendsBase{/****@returnZend\Authentication\Authenticat

php - 交响乐 :HOW TO Create Shared -General- (Helper) used in multiple bundles

我有很多辅助功能-分组在类中-用于(格式化字符串和日期,URL辅助),我想在几个包中使用和共享,我需要知道关于我可以在哪里放置这些辅助功能的最佳实践在bundle之间共享。我想到的是创建一个帮助包,然后在我项目中的另一个包中使用这个包,或者使用供应商帮助程序。那么我该如何做到这一点,以及创建用于多个bundle的共享助手的最佳实践是什么。如果有任何我可以看的引用,请与我分享。提前谢谢你。 最佳答案 最佳做法是创建一个包含这些类的PHP库。如果你真的需要Symfony集成(例如DIC配置),那么创建依赖于这个库的包。每个使用您的包的包

php - 我怎样才能增加codeigniter captcha helper的字体大小

我正在使用codeigniter*capctha*助手。问题是我无法增加字母的字体大小。我试着通过if($use_font==FALSE){$font_size=6;$x=rand(0,$img_width/($length/2));$y=0;}else{$font_size=20;$x=rand(0,$img_width/($length/1.5));$y=$font_size+2;}但是没有任何反应,如何改变字体大小,请帮忙。提前致谢。 最佳答案 您正在更改正确的参数,无论是在核心文件中还是在应用程序/助手文件中。仔细检查您使用

java - 错误 : annotation type not applicable to this kind of declaration

我正在尝试编译我正在编写的JavaWeb应用程序,但我遇到了编译错误,我不知道该如何处理。通过谷歌搜索,我发现了thisSO问题,但是提问者使用的是EJB,而我的错误是在JPA实体类中。这是Maven构建错误。[INFO]------------------------------------------------------------------------[INFO]BUILDFAILURE[INFO]------------------------------------------------------------------------[INFO]Totaltime:3