本文整理汇总了PHP中Transfer::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Transfer::init方法的具体用法?PHP Transfer::init怎么用?PHP Transfer::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transfer
的用法示例。
在下文中一共展示了Transfer::init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
public function display()
{
// Add a new payee if a request is submitted.
if (isset($_POST['addPayee'])) {
$payee = new Payees();
$payee->userID = $_SESSION['userID'];
$validate = new Validation();
// Validate the account name.
try {
$validate->accountName($_POST['addPayeeAccountName']);
} catch (ValidationException $e) {
$_SESSION['error'] = $e->getError();
}
if (isset($_SESSION['error'])) {
unset($_POST['addPayeeAccountName']);
header('Location: Payee-Add');
} else {
$payee->accountName = $_POST['addPayeeAccountName'];
unset($_POST['addPayeeAccountName']);
// Validate the nickname.
try {
$validate->accountNickname($_POST['addPayeeAccountNickname']);
} catch (ValidationException $e) {
$_SESSION['error'] = $e->getError();
}
if (isset($_SESSION['error'])) {
unset($_POST['addPayeeAccountNickname']);
header('Location: Payee-Add');
} else {
$payee->accountNickname = $_POST['addPayeeAccountNickname'];
unset($_POST['addPayeeAccountNickname']);
// Validate the BSB.
try {
$validate->accountBSB($_POST['addPayeeBSB']);
} catch (ValidationException $e) {
$_SESSION['error'] = $e->getError();
}
if (isset($_SESSION['error'])) {
unset($_POST['addPayeeBSB']);
header('Location: Payee-Add');
} else {
$payee->bsb = $_POST['addPayeeBSB'];
unset($_POST['addPayeeBSB']);
// Validate the account number.
try {
$validate->accountNumber($_POST['addPayeeAccountNumber']);
} catch (ValidationException $e) {
$_SESSION['error'] = $e->getError();
}
if (isset($_SESSION['error'])) {
unset($_POST['addPayeeAccountNumber']);
header('Location: Payee-Add');
} else {
$payee->accountNumber = $_POST['addPayeeAccountNumber'];
unset($_POST['addPayeeAccountNumber']);
// If all is ok, add the payee.
$payee->set();
}
}
}
}
}
// Display the New Funds Transfer Page.
$transfer = new Transfer();
$transfer->init();
include 'view/layout/transfer.php';
}