草庐IT

this-page

全部标签

php - Laravel 路由 : page you are looking for could not be found

我在Laravel中定义了一个路由,但是当我调用该路由时,我得到404(抱歉,找不到您要查找的页面。)路线是:einlagerungen/{$paletten_id}/bei_paletten_id路由定义Route::get('/',function(){returnview('welcome');});Route::get('einlagerungen/{$paletten_id}/bei_paletten_id',['as'=>'einlagerungen/bei_paletten_id','uses'=>'EinlagerungRestController@beiPalette

php - 从另一个类宽度 '$this' 调用类的静态方法

我遇到了一些问题。我想从另一个类调用类的static方法。类名和方法是动态创建的。做起来并不难:$class='className';$method='method';$data=$class::$method();但是,我想这样做classabc{staticpublicfunctionaction(){//somecode}}classxyz{protected$method='action';protected$class='abc';publicfunctiontest(){$data=$this->class::$this->method();}}如果我不将$this->cl

php - 在 PHP 中使用 "this"和 "self"

Use$thistorefertothecurrentobject.Useselftorefertothecurrentclass.Inotherwords,use$this->memberfornon-staticmembers,useself::$memberforstaticmembers.http://board.phpbuilder.com/showthread.php?10354489-RESOLVED-php-class-quot-this-quot-or-quot-self-quot-keywordclassDemo{privatestatic$name;private

php - 流体接口(interface)如何返回 $this 和值?

我对OOP比较陌生,所以浏览SimpleHTMLDOM的文档时我想知道它的方法如何使用方法链和返回值/对象的常规行为。例如我可以这样做:$html=newsimple_html_dom();$html->find('something');//Returnsobjectorarrayofobjects但我也可以:$html->find('something')->find('something_else');如果我正确理解方法链接,这意味着find()返回$this即它本身。此外,我的理解是使用方法链接返回$this,之后使用getter方法实际返回一个您可以使用/想要的值。例如:$o

php - 错误 : Using $this when not in object context

这个问题在这里已经有了答案:PHPFatalerror:Using$thiswhennotinobjectcontext(9个回答)关闭9年前。我已经查找了涵盖此错误的其他问题,但找不到适用于我的问题的案例。基本上,我的类中的静态方法调用一个非静态方法,该方法反过来调用另一个非静态方法。这会引发fatalerror:Fatalerror:Using$thiswhennotinobjectcontextinclass.phponline...我不明白为什么不能通过$this从另一个非静态类方法调用一个非静态类方法。是因为它们都是从静态函数调用的,因此没有$this实例吗?这是(简化的)类

php - TwitterOAuth : Uncaught exception 'This feature is temporarily unavailable'

我正在Wordpress中开发一个应用程序,它允许用户使用他们的Twitter帐户登录,然后将用户重定向到一个表单。在提交该表单时,一条推文将发送到用户的Twitter句柄。我正在使用Abraham的twitteroauth来实现TwitterOAuth。推特登录成功后的重定向模板源码:oauth("oauth/access_token",array("oauth_verifier"=>$_REQUEST['oauth_verifier']));//print_r($access_token);$_SESSION['access_token']=$access_token;}$acce

php - 如何在回调函数中注释 $this

尽管代码示例来自Laravel,但这不是Laravel问题!所以我有这部分代码classMacroServiceProviderextendsServiceProvider{publicfunctionboot(){Collection::macro('method_name',function(){return$this->map(function($item){//...dosomething;});});}}问题是$this不属于MacroServiceProvider而是属于Collection并且我的IDE和phpstan向我显示错误,当然.编辑:问题不明确。IDE认为$th

php - Magento : Special price not displaying in the product page

我将特价规则应用于商店中的所有产品。一旦一切都结束了,特价就会显示在除产品页面(显示完整产品信息)之外的所有页面中。我正在使用自定义主题。我的自定义主题有问题吗? 最佳答案 如果您尝试重新应用您的目录规则并且特价再次出现,请确保您的cron作业已针对目录价格规则进行设置。 关于php-Magento:Specialpricenotdisplayingintheproductpage,我们在StackOverflow上找到一个类似的问题: https://sta

php - 棘手的网站想法(不是你的一般想法,也不是 "will you program this for me?"请求)

再次重申:这不是为我编写任何程序的请求。我正在寻找更有经验的Web开发人员来告诉我我的想法是否真的可行,因为它涉及一些非常棘手的问题(至少,我是这么认为的)。拜托,如果要关闭此帖子,我能否至少得到一些关于我应该先发帖的建议?想象一下:您访问一个网站(比如malonsite.com)。您登录后,您会看到一个双Pane窗口。左侧是聊天列表(想想FB好友列表)。右侧是“浏览器”。聊天列表由已登录malonsite.com且与您使用“嵌入式”浏览器访问同一页面的其他人组成。每个用户都可以“允许关注者”,此时无论他们访问什么网站,他们的所有关注者都会“关注”。图片草图:我的能力:PHPMySQL

php - Symfony 应用程序 403 禁止错误 : You don't have permission to access/on this server

我试图在CentOS7linode服务器上运行symfony应用程序,但出现错误:Cannotservedirectory:NomatchingDirectoryIndex(index.html,index.php)我用这个配置为这个子域设置了一个虚拟主机:ServerAdminpak11273@gmail.comServerNamemisterServerAliasproject.mystuff.comDocumentRoot/var/www/html/projectErrorLog/var/www/html/project/logs/error.logCustomLog/var/w