本文整理汇总了PHP中bail函数的典型用法代码示例。如果您正苦于以下问题:PHP bail函数的具体用法?PHP bail怎么用?PHP bail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bail函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
function edit($params)
{
if (!isset($params['id'])) {
bail("Must haz id to show you that!");
}
$this->data->staff = new Staff($params['id']);
}
示例2: namespaceAlias
function namespaceAlias($alias)
{
if (!$alias) {
bail('You must specify an alias.');
}
return '/' . $this->getStaff()->getPermalink() . '/' . $alias;
}
示例3: expandversion
function expandversion($vstr)
{
$v = explode('.', $vstr);
if ($vstr == '' || count($v) == 0 || count($v) > 4) {
bail('Bogus version.');
}
$vlen = count($v);
$ret = array();
$hasplus = 0;
for ($i = 0; $i < 4; $i++) {
if ($i > $vlen - 1) {
// this version chunk was not specified; give 0
$ret[] = 0;
} else {
$s = $v[$i];
if ($i == 3) {
// need to check for +
$slen = strlen($s);
if ($s[$slen - 1] == '+') {
$s = substr($s, 0, $slen - 1);
$hasplus = 1;
}
}
$ret[] = intval($s);
}
}
$ret[] = $hasplus;
return $ret;
}
示例4: destroy
function destroy($params)
{
$params['id'] ? $clientuser = new ClientUser($params['id']) : bail('no company selected');
$name = $clientuser->getName();
$clientuser->destroy();
Render::msg($name . ' Deleted.', 'bad');
$this->redirectTo(array('controller' => 'ClientUser', 'action' => 'index'));
}
示例5: controller_path
function controller_path()
{
$path = 'controller/' . $this->controller . '.php';
if (!file_exists($path)) {
bail('requested controller "' . $this->controller . '" does not exist.');
}
return $path;
}
示例6: show
function show($params)
{
if (!isset($params['id'])) {
bail("id is a required param.");
}
$this->data->batch = new InvoiceBatch($params['id']);
$this->data->invoices = $this->data->batch->getInvoices();
}
示例7: getFieldSetFor
function getFieldSetFor($obj)
{
if (!is_a($obj, 'ActiveRecord')) {
bail('Cannot get fields for non-ActiveRecord objects');
}
$obj->id ? $fields = new FieldSet($obj) : ($fields = new FieldSet($obj, $this->incrementNewObjectCounterFor($obj)));
return $fields;
}
示例8: f2b_block_user_enumeration
function f2b_block_user_enumeration($redirect_url, $requested_url)
{
if (intval(@$_GET['author'])) {
f2b_openlog();
syslog(LOG_NOTICE, 'Blocked user enumeration attempt from ' . f2b_remote_addr());
bail();
}
return $redirect_url;
}
示例9: destroy
function destroy($params)
{
if (empty($params['id'])) {
bail('Required parameter id not set.');
}
$contact = new Contact($params['id']);
$contact->destroy();
$this->redirectTo(array('controller' => 'Contact', 'action' => 'index'));
}
示例10: destroy
function destroy($params)
{
if (!isset($params['id'])) {
bail("Must haz id to do that!");
}
$inv = new Invoice($params['id']);
$inv->destroy();
$this->redirectTo(array('controller' => 'Invoice', 'action' => 'index'));
}
示例11: destroy
function destroy($params)
{
if (empty($params['id'])) {
bail('required param["id"] not set.');
}
$bookmark = new bookmark($params['id']);
$bookmark->destroy();
$this->redirectBack();
}
示例12: destroy
function destroy($params)
{
if (empty($params['id'])) {
bail('Required param["id"] not set.');
}
$note = new note($params['id']);
$note->destroy();
$this->redirectTo(array('controller' => 'Note', 'action' => 'index'));
}
示例13: destroy
function destroy($params)
{
if (!isset($params['id'])) {
bail('Required parameter "id" is missing.');
}
$inv = new Charge($params['id']);
$inv->destroy();
$this->redirectTo(array('controller' => 'Charge', 'action' => 'index'));
}
示例14: setSource
function setSource($sourcename)
{
parent::setSource($sourcename);
$this->_itemdata_keys = $this->_getColumnNames($this->datatable);
if (!is_array($this->_itemdata_keys)) {
bail('This model has no collumns in the database. Check to see if you ran the latest migrations, and make sure you set the correct datatable name on the model');
}
$this->_allowed_keys = $this->_itemdata_keys;
}
示例15: destroy
function destroy($params)
{
if (!$params['id']) {
bail('Required $params["id"] not present.');
}
$h = new Hour($params['id']);
$support_contract_id = $h->get('support_contract_id');
$h->destroy();
isset($params['redirect']) ? $redirect = $params['redirect'] : ($redirect = array('controller' => 'SupportContract', 'action' => 'show', 'id' => $support_contract_id));
$this->redirectTo($redirect);
}