本文整理匯總了PHP中webservice::get_external_function_by_id方法的典型用法代碼示例。如果您正苦於以下問題:PHP webservice::get_external_function_by_id方法的具體用法?PHP webservice::get_external_function_by_id怎麽用?PHP webservice::get_external_function_by_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類webservice
的用法示例。
在下文中一共展示了webservice::get_external_function_by_id方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
switch ($action) {
case 'add':
$PAGE->navbar->add(get_string('addfunctions', 'webservice'));
/// Add function operation
if (confirm_sesskey() and $service and empty($service->component)) {
$mform = new external_service_functions_form(null, array('action' => 'add', 'id' => $service->id));
//cancelled add operation, redirect to function list page
if ($mform->is_cancelled()) {
redirect($functionlisturl);
}
//add the function to the service then redirect to function list page
if ($data = $mform->get_data()) {
ignore_user_abort(true);
// no interruption here!
foreach ($data->fids as $fid) {
$function = $webservicemanager->get_external_function_by_id($fid, MUST_EXIST);
// make sure the function is not there yet
if (!$webservicemanager->service_function_exists($function->name, $service->id)) {
$webservicemanager->add_external_function_to_service($function->name, $service->id);
}
}
redirect($functionlisturl);
}
//Add function operation page output
echo $OUTPUT->header();
echo $OUTPUT->heading($service->name);
$mform->display();
echo $OUTPUT->footer();
die;
}
break;