本文整理匯總了PHP中MenuItem::Edit方法的典型用法代碼示例。如果您正苦於以下問題:PHP MenuItem::Edit方法的具體用法?PHP MenuItem::Edit怎麽用?PHP MenuItem::Edit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MenuItem
的用法示例。
在下文中一共展示了MenuItem::Edit方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: post
/**
* @method POST
*/
function post()
{
// get an authuser
$token = Utilities::ValidateJWTToken(apache_request_headers());
// check if token is not null
if ($token != NULL) {
parse_str($this->request->data, $request);
// parse request
$menuItemId = $request['menuItemId'];
$name = $request['name'];
$cssClass = $request['cssClass'];
$url = $request['url'];
$pageId = $request['pageId'];
MenuItem::Edit($menuItemId, $name, $cssClass, $url, $pageId);
// return a json response
$response = new Tonic\Response(Tonic\Response::OK);
return $response;
} else {
// unauthorized access
return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
}
}
示例2: update
/**
* @method POST
*/
function update($menuItemUniqId)
{
// get an authuser
$authUser = new AuthUser();
if (isset($authUser->UserUniqId)) {
// check if authorized
parse_str($this->request->data, $request);
// parse request
$name = $request['name'];
$cssClass = $request['cssClass'];
$url = $request['url'];
MenuItem::Edit($menuItemUniqId, $name, $cssClass, $url);
// return a json response
$response = new Tonic\Response(Tonic\Response::OK);
return $response;
} else {
// unauthorized access
return new Tonic\Response(Tonic\Response::UNAUTHORIZED);
}
}