本文整理匯總了PHP中Region::load_from_Request方法的典型用法代碼示例。如果您正苦於以下問題:PHP Region::load_from_Request方法的具體用法?PHP Region::load_from_Request怎麽用?PHP Region::load_from_Request使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Region
的用法示例。
在下文中一共展示了Region::load_from_Request方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Region
case 'create':
// Record new region
// Record new region
case 'create_new':
// Record region and create new
// Record region and create new
case 'create_copy':
// Record region and create similar
// Insert new region:
$edited_Region = new Region();
// Check that this action request is not a CSRF hacked request:
$Session->assert_received_crumb('region');
// Check permission:
$current_User->check_perm('options', 'edit', true);
// Load data from request
if ($edited_Region->load_from_Request()) {
// We could load data from form without errors:
// Insert in DB:
$DB->begin();
$q = $edited_Region->dbexists();
if ($q) {
// We have a duplicate entry:
param_error('rgn_code', sprintf(T_('This region already exists. Do you want to <a %s>edit the existing region</a>?'), 'href="?ctrl=regions&action=edit&rgn_ID=' . $q . '"'));
} else {
$edited_Region->dbinsert();
$Messages->add(T_('New region created.'), 'success');
}
$DB->commit();
if (empty($q)) {
// What next?
switch ($action) {