草庐IT

ACTION_ACL_CONNECTED

全部标签

php - Zend Framework - 如何从 Action 助手中调用 Controller 的 redirect()

我正在ActionHelper的preDispatch方法中进行ACL检查。当它失败时,我想调用ActionController的_redirect方法,但是我很难做到这一点。在这篇文章所附的评论中,zend-framework,callanactionhelperfromwithinanotheractionhelper,我看到两个解决方案。首先,Controller作为$this->_actionController从helper访问。在第二个中,使用$this->getActionController()访问它。我尝试了以下两种方法:$this->_actionControlle

php - 在 Laravel 5/6/7/8/9 中使用表单请求验证时出现错误 "This action is unauthorized."

我做了一些像这样的门:Gate::define('update-post',function($user,Post$post){return$user->hasAccess(['update-post'])or$user->id==$post->user_id;});我检查了我的数据库,它具有更新后访问权限,并且用户ID与帖子中的相同。但我得到了:Thisactionisunauthorized.错误。那我在这里做错了吗?谢谢。 最佳答案 我前段时间在开始使用FormRequest的时候遇到过类似的问题数据验证类。我注意到以下几点:

php - 在 Laravel 4 中获取 Controller 和 Action 名称

我正在尝试访问当前Controller的名称和当前方法,以将其作为变量传递到我的View。我从网上找到的指示中尝试了几种方法,但它们不起作用,所以我认为它们适用于Laravel3。这是我试过的Request::$route->controller给予Accesstoundeclaredstaticproperty:Illuminate\Support\Facades\Request::$route和Request::route()->controller给予CalltoundefinedmethodIlluminate\Http\Request::route()

php - 代替 Form Action 和方法

我发现没有像在中那样的“Action”和“方法”我想在按下按钮提交后获取在文本框中输入的值。我怎样才能像前者一样(获取通过POST或GET提交的值)?此外,如果我想获取URL中传递的值http://localhost/index.php/something?value=75&today=Wed例如,75和Wed。 最佳答案 试试这个:echoform_open('controller/somepage',array('method'=>'get')); 关于php-代替FormActio

php - 覆盖 Magento Action

有很多次我想做的只是覆盖Controller上的特定操作,而不是整个事情。在大多数情况下,我只是覆盖了整个Controller,但我想知道是否有更好的方法?Magento是否有办法只覆盖Controller中的单个操作,而使原始Controller和其他操作保持原样?例子:classMage_Core_AwesomeControllerextendsMage_Core_Controller_Front_Action{//hasurlofawesome/indexpublicfunctionindexAction(){//SomeAwesomecode}//hasurlofawesome

php - 获取 laravel 5 中所有 Controller 和 Action 的列表

我是laravel的新手,想获取所有Controller的列表和该Controller中的操作列表。只是想知道是否有办法通过代码获取所有Controller及其所有方法的列表?谢谢,打碟机 最佳答案 根据您解释需要了解Controller操作的方式,操作似乎已经映射到路由,这意味着您可以使用路由获取映射Controller和操作的列表。以下代码将生成一组已注册的路由Controller操作:$controllers=[];foreach(Route::getRoutes()->getRoutes()as$route){$action

php - Facebook OAuthException : "user hasn' t authorized the application to perform this action"

使用FacebookPHPSDK,当我尝试发布状态更新时出现以下错误:Fatalerror:UncaughtOAuthException:(#200)Theuserhasn'tauthorizedtheapplicationtoperformthisaction这些是我采取的步骤:获取代码:https://graph.facebook.com/oauth/authorize?client_id=FB_APP_ID&redirect_uri=REDIRECT_URI获取访问token:https://graph.facebook.com/oauth/access_token?client

php - 我可以渲染 View 而不在 zend 框架 2 的 Action Controller 中返回它吗?

现在我这样做:publicfunctionindexAction(){...$view=newViewModel(array('foo'=>'bar',));return$view;}问题是我想在$view渲染之后和布局渲染之前做一些事情:publicfunctionindexAction(){...$view=newViewModel(array('foo'=>'bar',));$layout=$this->layout();$layout->content=$view->render();...//hereIwanttodosomeimportantaction...$html=$

php - 如何通过 jquery/ajax 在 zend 框架中调用 Controller / Action ?

如何通过jquery/ajax调用zend框架中的controller/action?我试过了$(function(){$(".tbl_repeattbody").tableDnD({onDrop:function(table,row){varorders=$.tableDnD.serialize();$.post("baseUrl();?>/Indexcodelist/indexcodelistsearch/",{order:orders});}});});此代码未调用Controller的操作方法,我该如何实现它? 最佳答案 在

php - 实现ACL约束,不仅仅是允许/拒绝

我开发了一个用于应用程序的小型但有效的MVC样式框架,并且我正在实现ACL每个请求检查。快速详细信息:PHP5.3+;MySQL5.1+;自定义框架,“类MVC”到目前为止,ACL检查很简单“deny-if-notwhite-listing”;每个group都可以分配给某些请求处理程序的权限。例如:privilegepermission+----------+---------------++---------------+---------------+|group_id|permission_id||permission_id|handler_key|+----------+---