草庐IT

class_methods

全部标签

php - Facebook 通知 API : "This method must be called with an app access_token"

我正在尝试使用GraphAPIExplorer从我的应用程序发送Facebook通知。所以我选择了我的应用程序,POST,并在/之后输入了这个字符串11093774316/notifications?access_token=430xxxxxx156|HU0ygMtxxxxxxxxxxxxikVKg&template=Hello&href=index.php访问字符串是我在“访问token调试器”上得到的,我检查它是否正常。但是,我收到此错误消息:{"error":{"message":"(#15)Thismethodmustbecalledwithanappaccess_token.

PHP 如何检查子类是否覆盖了父类(super class)的方法?

使用PHP,一个类如何确定一个子类是否覆盖了它的方法?给定以下两个类:classSuperclass{protectedfunctiondoFoo($data){//empty}protectedfunctiondoBar($data){//empty}}classSubclassextendsSuperclass{protectedfunctiondoFoo($data){//dosomething}}如何将一个方法添加到父类(superclass)中,以根据其哪些方法被覆盖执行不同的操作?例如:if([doFooisoverridden]){//Performanactionwit

php - Symfony2 找不到 "GET/": Method Not Allowed (Allow: POST) 的路由

我在routing.yml中的一个包中定义了两条路由,它们是:dm_dashboard:pattern:/defaults:{_controller:DigitalManagerERPBundle:Default:login}methods:[GET]dm_dashboard:pattern:/defaults:{_controller:DigitalManagerERPBundle:Default:processLogin}methods:[POST]即为GET方法选择第一个路由,为POST方法选择第二个路由。但是当我试图让它进入路径时,我得到了这个错误Noroutefoundfor

php - 拉维尔 4 : Getter and Setter Methods

我试图让Getter和Setter方法工作(从Laravel3到Laravel4)但显示错误。这里有什么工作吗?它们在密码大小写中非常有用:publicfunctionset_password($password){$this->set_attribute('hashed_password',Hash::make($password));}http://three.laravel.com/docs/database/eloquent 最佳答案 刚找到答案:现在它叫做访问器和修改器https://laravel.com/docs/5.

php - 我可以只使用 _(下划线)作为类(class)名称吗?

我可以只使用_(下划线)作为类名吗?如果是,那么如何创建对象?如果不是,为什么不呢?class_{} 最佳答案 manual可能是你最好的friend。Theclassnamecanbeanyvalidlabel,provideditisnotaPHPreservedword.Avalidclassnamestartswithaletterorunderscore,followedbyanynumberofletters,numbers,orunderscores.Asaregularexpression,itwouldbeexpr

php - 严重性 : 8192 Message: Methods with the same name as their class will not be constructors in a future version of PHP;

严重性:8192消息:在未来的PHP版本中,与类同名的方法将不再是构造函数;CI_Pagination有一个已弃用的构造函数文件名:libraries/Pagination.php行号:27classCI_Pagination{var$base_url='';//Thepagewearelinkingtovar$total_rows='';//Totalnumberofitems(databaseresults)var$per_page=10;//Maxnumberofitemsyouwantshownperpagevar$num_links=2;//Numberof"digit"li

PHP5 : Specifying a datatype in method parameters

我有一个看起来像这样的函数classNSNode{functioninsertAfter(NSNode$node){...}}我希望能够使用该函数来指示节点是在开头插入的,因此它在nothing之后。我的想法是null表示“无”,所以我会这样编写我的函数调用:$myNode->insertAfter(null);除了PHP会抛出一个错误,指出它需要一个NSNode对象。我想在我的函数中坚持使用严格的数据类型,但希望能够指定一个空值。那么,除了将其更改为functioninsertAfter($node){}之外,有没有办法将其他内容传递给该函数?更新:我接受了Owen的回答,因为它本身

php - 如何从帖子中获取数据到类(class)

如果我有这样的表单(不是所有代码只有一个字段和我的输入):FirstName:是否可以从表单中获取数据,然后将该数据输出到另一个页面。我现在拥有它的方式只是将帖子从表单回显到页面:';echo'';echo'Wehaveyouremailaddressas:"';echo"{$email_address}";echo'"';?>我不确定如何开始,但我希望帖子中的数据先上课。因此,如果我创建一个名为registeredUser的类,我将如何从我的表单中获取该数据? 最佳答案 你好,我想你首先需要一些关于OPP的教程你管http://w

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 - 教义 - [语义错误] - 错误 : Class has no field or association

我正在尝试使用Doctrine的DQL运行查询在存储库中,我收到以下错误:QueryExceptioninQueryException.phpline63:[SemanticalError]line0,col100near'test_suite_id':Error:ClassApplication\Model\Entity\Pagehasnofieldorassociationnamedtest_suite_id协会一个User可以有多个TestSuite。一个TestSuite可以有多个Page。因此,我在User和TestSuite以及TestSuite和Page分别。以下是我的实