当前位置: 首页>>代码示例>>PHP>>正文


PHP bail函数代码示例

本文整理汇总了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']);
 }
开发者ID:radicaldesigns,项目名称:gtd,代码行数:7,代码来源:StaffController.php

示例2: namespaceAlias

 function namespaceAlias($alias)
 {
     if (!$alias) {
         bail('You must specify an alias.');
     }
     return '/' . $this->getStaff()->getPermalink() . '/' . $alias;
 }
开发者ID:radicaldesigns,项目名称:gtd,代码行数:7,代码来源:Bookmark.php

示例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;
}
开发者ID:jpetrell,项目名称:gecko-dev,代码行数:29,代码来源:VersionCheck.php

示例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'));
 }
开发者ID:radicaldesigns,项目名称:gtd,代码行数:8,代码来源:ClientUserController.php

示例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;
 }
开发者ID:radicaldesigns,项目名称:gtd,代码行数:8,代码来源:Router.php

示例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();
 }
开发者ID:radicaldesigns,项目名称:gtd,代码行数:8,代码来源:InvoiceBatchController.php

示例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;
 }
开发者ID:radicaldesigns,项目名称:gtd,代码行数:8,代码来源:Form.php

示例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;
 }
开发者ID:younghacker,项目名称:wp-fail2ban,代码行数:9,代码来源:wp-fail2ban.php

示例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'));
 }
开发者ID:radicaldesigns,项目名称:gtd,代码行数:9,代码来源:ContactController.php

示例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'));
 }
开发者ID:radicaldesigns,项目名称:gtd,代码行数:9,代码来源:InvoiceController.php

示例11: destroy

 function destroy($params)
 {
     if (empty($params['id'])) {
         bail('required param["id"] not set.');
     }
     $bookmark = new bookmark($params['id']);
     $bookmark->destroy();
     $this->redirectBack();
 }
开发者ID:radicaldesigns,项目名称:gtd,代码行数:9,代码来源:BookmarkController.php

示例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'));
 }
开发者ID:radicaldesigns,项目名称:gtd,代码行数:9,代码来源:NoteController.php

示例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'));
 }
开发者ID:radicaldesigns,项目名称:gtd,代码行数:9,代码来源:ChargeController.php

示例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;
 }
开发者ID:radicaldesigns,项目名称:gtd,代码行数:9,代码来源:Record.php

示例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);
 }
开发者ID:radicaldesigns,项目名称:gtd,代码行数:11,代码来源:SupportHourController.php


注:本文中的bail函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。