本文整理汇总了PHP中Rights::getDataCsrf方法的典型用法代码示例。如果您正苦于以下问题:PHP Rights::getDataCsrf方法的具体用法?PHP Rights::getDataCsrf怎么用?PHP Rights::getDataCsrf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rights
的用法示例。
在下文中一共展示了Rights::getDataCsrf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAssignPermissionLink
/**
* Returns the markup for the assign permission link.
* @param CAuthItem $role the role the permission is for.
* @return string the markup.
*/
public function getAssignPermissionLink(CAuthItem $role)
{
$csrf = Rights::getDataCsrf();
return CHtml::link(Rights::t('core', ''), '#', array('onclick' => "\n\t\t\t\tjQuery.ajax({\n\t\t\t\t\ttype:'POST',\n\t\t\t\t\turl:'" . Yii::app()->controller->createUrl('authItem/assign', array('name' => urlencode($role->name), 'child' => urlencode($this->owner->name))) . "',\n\t\t\t\t\tdata:{ ajax:1 {$csrf} },\n\t\t\t\t\tsuccess:function() {\n\t\t\t\t\t\t\$('#permissions').load('" . Yii::app()->controller->createUrl('authItem/permissions') . "', { ajax:1 {$csrf} });\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn false;\t\t\t\t\n\t\t\t", 'class' => 'fa fa-plus', 'title' => 'Asignar'));
}
示例2: getAssignPermissionLink
/**
* Returns the markup for the assign permission link.
* @param CAuthItem $role the role the permission is for.
* @return string the markup.
*/
public function getAssignPermissionLink(CAuthItem $role)
{
$csrf = Rights::getDataCsrf();
$img = CHtml::image(Yii::app()->baseUrl . '/images/unchecked.png', '', array('style' => 'height:16px'));
return CHtml::link($img, '#', array('title' => Rights::t('core', 'Assign'), 'onclick' => "\n\t\t\t\tjQuery.ajax({\n\t\t\t\t\ttype:'POST',\n\t\t\t\t\turl:'" . Yii::app()->controller->createUrl('authItem/assign', array('name' => urlencode($role->name), 'child' => urlencode($this->owner->name))) . "',\n\t\t\t\t\tdata:{ ajax:1 {$csrf} }, \n\t\t\t\t\tsuccess:function() {\n\t\t\t\t\t\t\$('#permissions').load('" . Yii::app()->controller->createUrl('authItem/permissions') . "', { ajax:1 {$csrf} });\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn false;\t\t\t\t\n\t\t\t", 'class' => 'assign-link'));
}