• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP param函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中param函数的典型用法代码示例。如果您正苦于以下问题:PHP param函数的具体用法?PHP param怎么用?PHP param使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了param函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: buildLinks

 public function buildLinks()
 {
     $links = array();
     $dataPath = Utils::dataViewPath('navigations');
     $menuItems = (include $dataPath . '/sub.php');
     $c = app()->controller->id;
     foreach ($menuItems as $itemInfo) {
         if (is_array($itemInfo[1])) {
             $firstController = '';
             foreach ($itemInfo[1] as $cId => $title) {
                 if (empty($firstController)) {
                     $firstController = $cId;
                 }
                 if ($c == $cId) {
                     $links[t($itemInfo[0])] = url($firstController);
                     $links[t($title)] = url(param('adminUrl') . $cId);
                     break;
                 }
             }
         } else {
             if ($c == $itemInfo) {
                 $links[t($itemInfo[1])] = url(param('adminUrl') . $c);
                 break;
             }
         }
     }
     $links[] = $this->getLastTitle();
     return $links;
 }
开发者ID:rajveer4155,项目名称:vidmgr,代码行数:29,代码来源:BreadCrumbs.php


示例2: search

 public function search()
 {
     $criteria = new CDbCriteria();
     $criteria->order = 'id DESC';
     $criteria->compare('apartment_id', $this->apartment_id, true);
     return new CActiveDataProvider($this, array('criteria' => $criteria, 'pagination' => array('pageSize' => param('adminPaginationPageSize', 20))));
 }
开发者ID:barricade86,项目名称:raui,代码行数:7,代码来源:Bookingcalendar.php


示例3: standardizeData

 private function standardizeData($data)
 {
     $result = array();
     if (is_array($data) && !empty($data)) {
         $i = 0;
         $model = str_replace('_', ' ', app()->controller->getModel(null)->tableName());
         foreach ($data as $item) {
             // Title
             if (!isset($item['title'])) {
                 $item['title'] = ucfirst($item['action']);
             }
             // Confirm message
             if (!isset($item['confirm'])) {
                 $action = strtolower($item['title']);
                 $item['confirm'] = str_replace(array('{action}', '{model}'), array($action, $model), $this->confirmMsg);
             }
             // Url
             if (!isset($item['params'])) {
                 $item['params'] = array();
             }
             $item['url'] = url(param('adminUrl') . app()->controller->id . '/bulk' . ucfirst($item['action']), $item['params']);
             $result[$i]['label'] = t($item['title']);
             $result[$i]['url'] = '#';
             $result[$i]['linkOptions']['bulkUrl'] = $item['url'];
             if (isset($item['confirm'])) {
                 $result[$i]['linkOptions']['confirmMsg'] = $item['confirm'];
             }
             $i++;
         }
     }
     return $result;
 }
开发者ID:rajveer4155,项目名称:vidmgr,代码行数:32,代码来源:BulkActions.php


示例4: actionSaveSort

 public function actionSaveSort()
 {
     $objTypeId = Yii::app()->request->getParam('id', NULL);
     $sort = Yii::app()->request->getParam('sort');
     if (count($sort) >= param('searchMaxField', 15)) {
         HAjax::jsonError(tt('Search max field ') . param('searchMaxField', 3));
     }
     if ($objTypeId !== NULL && $sort && is_array($sort)) {
         $elements = SearchForm::getSearchFields();
         $sql = "DELETE FROM {{search_form}} WHERE obj_type_id=:id AND status!=:status";
         Yii::app()->db->createCommand($sql)->execute(array(':id' => $objTypeId, ':status' => SearchFormModel::STATUS_NOT_REMOVE));
         $i = 3;
         foreach ($sort as $field) {
             if (!isset($elements[$field])) {
                 continue;
             }
             $search = new SearchFormModel();
             $search->attributes = array('obj_type_id' => $objTypeId, 'field' => $field, 'status' => $elements[$field]['status'], 'sorter' => $i, 'formdesigner_id' => isset($elements[$field]['formdesigner_id']) ? $elements[$field]['formdesigner_id'] : 0);
             $search->save();
             $i++;
         }
         // delete assets js cache
         ConfigurationModel::clearGenerateJSAssets();
         HAjax::jsonOk();
     }
     HAjax::jsonError();
 }
开发者ID:barricade86,项目名称:raui,代码行数:27,代码来源:SearchController.php


示例5: settings

 function settings($action)
 {
     global $_out, $_struct;
     if (($xml = $this->getDataXML()) && ($e = $xml->getElementById('settings'))) {
         $form = new form($e);
         $form->replaceURI(array('MODULE' => $this->getId(), 'SECTION' => $this->getSection()->getId(), 'PATH_DATA_FILE_CLIENT' => ABS_PATH_DATA_CLIENT . ap::id($this->getSection()->getId()) . '.xml', 'PATH_DATA_FILE_AP' => ABS_PATH_DATA_AP . ap::id($this->getSection()->getId()) . '.xml'));
         if ($ff = $form->getField('section')) {
             apSectionEdit::seclist(ap::getClientstructure()->de(), $ff, $ar = array());
         }
         switch ($action) {
             case 'update':
             case 'apply_update':
                 $form->save($_REQUEST);
                 break;
             case 'edit':
                 if (($id = param('section')) && ($sec = $_struct->getSection($id)) && ($modules = $sec->getModules())) {
                     $xml = new xml(null, 'modules', false);
                     foreach ($modules as $m) {
                         $xml->de()->appendChild($xml->importNode($m->getRootElement(), false));
                     }
                     ap::ajaxResponse($xml);
                 }
                 break;
         }
         $form->load();
         $_out->addSectionContent($form->getRootElement());
         $this->addTemplate('tpl.xsl');
     }
 }
开发者ID:PapaKot,项目名称:Horowitz,代码行数:29,代码来源:apAnnounce.php


示例6: page

 /**
  * Returns the current page number
  *
  * @return int
  */
 public function page()
 {
     if (!is_null($this->page)) {
         return $this->page;
     }
     if ($this->options['page']) {
         $this->page = $this->options['page'];
     } else {
         $this->page = $this->options['method'] == 'query' ? get($this->options['variable']) : param($this->options['variable']);
     }
     // make sure the page is an int
     $this->page = intval($this->page);
     // set the first page correctly
     if ($this->page == 0) {
         $this->page = 1;
     }
     // sanitize the page if too low
     if ($this->page < 1) {
         $this->redirect();
         $this->page = 1;
     }
     // sanitize the page if too high
     if ($this->page > $this->pages && $this->count > 0) {
         $this->redirect();
         $this->page = $this->lastPage();
     }
     // return the sanitized page number
     return $this->page;
 }
开发者ID:irenehilber,项目名称:kirby-base,代码行数:34,代码来源:pagination.php


示例7: tagcloud

/**
 * Tagcloud plugin
 *
 * @author Bastian Allgeier <[email protected]>
 * @version 2.0.0
 */
function tagcloud($parent, $options = array())
{
    // default values
    $defaults = array('limit' => false, 'field' => 'tags', 'children' => 'visible', 'baseurl' => $parent->url(), 'param' => 'tag', 'sort' => 'results', 'sortdir' => 'desc');
    // merge defaults and options
    $options = array_merge($defaults, $options);
    switch ($options['children']) {
        case 'invisible':
            $children = $parent->children()->invisible();
            break;
        case 'visible':
            $children = $parent->children()->visible();
            break;
        default:
            $children = $parent->children();
            break;
    }
    $tags = $children->pluck($options['field'], ',');
    $tags = array_count_values($tags);
    $cloud = array();
    $ds = DS == '/' ? ':' : ';';
    foreach ($tags as $tag => $count) {
        $cloud[$tag] = new Obj(array('results' => $count, 'name' => $tag, 'url' => $options['baseurl'] . '/' . $options['param'] . $ds . urlencode($tag), 'isActive' => urldecode(param($options['param'])) == $tag));
    }
    $cloud = new Collection($cloud);
    $cloud = $cloud->sortBy($options['sort'], $options['sortdir']);
    if ($options['limit']) {
        $cloud = $cloud->limit($options['limit']);
    }
    return $cloud;
}
开发者ID:filmhood,项目名称:filmhood-kirby,代码行数:37,代码来源:tagcloud.php


示例8: search

 public function search()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('page', $this->page, true);
     $criteria->compare('is_offline', $this->is_offline, true);
     return new CActiveDataProvider($this, array('criteria' => $criteria, 'sort' => array('defaultOrder' => 'date_created DESC'), 'pagination' => array('pageSize' => param('adminPaginationPageSize', 20))));
 }
开发者ID:barricade86,项目名称:raui,代码行数:7,代码来源:Service.php


示例9: reserv_permit

function reserv_permit($ruid, $euid, $confirm)
{
    global $xoopsUser, $xoopsModule, $isadmin, $xoopsModuleConfig;
    if (!is_object($xoopsUser)) {
        if ($confirm == param('key')) {
            return true;
        }
        if ($xoopsModuleConfig['member_only'] == ACCEPT_MEMBER) {
            return false;
        }
        return true;
    }
    // administrator has permit
    if ($isadmin) {
        return true;
    }
    $uid = $xoopsUser->getVar('uid');
    // reservation person
    if ($uid == $ruid && $confirm == param('key')) {
        return true;
    }
    // event poster
    if ($uid == $euid) {
        return true;
    }
    return false;
}
开发者ID:nbuy,项目名称:xoops-modules-eguide,代码行数:27,代码来源:reserv.php


示例10: actionIndex

 public function actionIndex($tab = null)
 {
     $allUsers = $pages = null;
     $itemsProvider = new CArrayDataProvider(array());
     $this->setActiveMenu('my_mailbox');
     $return = Messages::getAllContactUsers(Yii::app()->user->id);
     if ($return) {
         $allUsers = $return['allUsers'];
         $pages = $return['pages'];
         if (count($allUsers)) {
             $itemsProvider = new CArrayDataProvider($allUsers, array('pagination' => array('pageSize' => param('userPaginationPageSize', 20))));
         }
     }
     switch ($tab) {
         case "inbox":
             $messages = Messages::model()->findAll('id_userTo=:toUser AND is_deleted<>:isDeleted', [':toUser' => Yii::app()->user->id, ':isDeleted' => Messages::MESSAGE_ACTIVE]);
             break;
         case "outbox":
             $messages = Messages::model()->findAll('id_userFrom=:fromUser AND is_deleted<>:isDeleted', [':fromUser' => Yii::app()->user->id, ':isDeleted' => Messages::MESSAGE_ACTIVE]);
             break;
         case "admin":
             $sql = "select * from bt_messages WHERE is_deleted<>" . Messages::MESSAGE_ACTIVE . "\n                              AND EXISTS(select null FROM bt_users WHERE id=id_userFrom\n                                                                      AND role IN('admin','moderator'))";
             $messages = Messages::model()->findBySql($sql);
             break;
         default:
             $messages = Messages::model()->findAll('id_userTo=:toUser AND is_deleted<>:isDeleted', [':toUser' => Yii::app()->user->id, ':isDeleted' => Messages::MESSAGE_ACTIVE]);
             break;
     }
     $this->render('index', array('allUsers' => $allUsers, 'pages' => $pages, 'itemsProvider' => $itemsProvider, 'messages' => $messages));
 }
开发者ID:barricade86,项目名称:raui,代码行数:30,代码来源:MainController.php


示例11: body

 protected function body()
 {
     echo '<div class="error-wrapper">';
     echo '<h1>We have an error!!</h1>';
     echo '<h2>The error is: ' . param('error') . '</h2>';
     echo '</div>';
 }
开发者ID:pman117,项目名称:qdinka,代码行数:7,代码来源:ErrorPageClass.php


示例12: b_wp_calendar_show

 function b_wp_calendar_show($option, $wp_num = "")
 {
     global $wpdb, $siteurl, $wp_id, $wp_inblock, $xoopsConfig, $use_cache, $m, $monthnum, $year, $wp_mod, $wp_base;
     $id = 1;
     $use_cache = 1;
     if ($wp_num == "") {
         $wp_id = $wp_num;
         $wp_inblock = 1;
         include dirname(__FILE__) . '/../wp-config.php';
         $wp_inblock = 0;
     }
     if (current_wp()) {
         param('m', 'integer', '');
         param('monthnum', 'integer', '');
         param('year', 'integer', '');
         $m = array_key_exists('m', $_GET) ? $_GET['m'] : '';
         $monthnum = array_key_exists('monthnum', $_GET) ? $_GET['monthnum'] : '';
         $year = array_key_exists('year', $_GET) ? $_GET['year'] : '';
     }
     ob_start();
     block_style_get($wp_num);
     get_calendar(1);
     $block['content'] = ob_get_contents();
     ob_end_clean();
     return $block;
 }
开发者ID:BackupTheBerlios,项目名称:nobunobuxoops-svn,代码行数:26,代码来源:wp_calendar.php


示例13: run

 function run()
 {
     global $_out, $_sec;
     if (ap::isCurrentModule($this)) {
         ap::addMessage($this->getMessage());
         if ($form = $this->getForm()) {
             $form->replaceURI(array('ID' => $_sec->getId(), 'MD' => $this->getId(), 'PARENT' => $this->getSection()->GetParent()->getId()));
             switch ($action = param('action')) {
                 case 'save':
                     $values = $this->initImages($form, true);
                     $values = array_merge($_REQUEST, $values);
                     $form->save($values);
                     $this->updateImagesSize($form);
                     $this->redirect('save_ok');
                     break;
                 case 'fileinfo':
                     if (($path = urldecode(param('path'))) && ($f = ap::getFileInfo($_SERVER['DOCUMENT_ROOT'] . $path))) {
                         $f['path'] = $path;
                         $xml = new xml(null, 'file', false);
                         foreach ($f as $tagName => $value) {
                             $xml->de()->appendChild($xml->createElement($tagName, null, $value));
                         }
                         ap::ajaxResponse($xml);
                     }
                     vdump('Error file not found ' . $path);
                     break;
             }
             $this->initImages($form, false);
             $form->load();
             $_out->elementIncludeTo($form->getRootElement(), '/page/section');
         } else {
             throw new Exception('Form not found', EXCEPTION_XML);
         }
     }
 }
开发者ID:PapaKot,项目名称:Horowitz,代码行数:35,代码来源:apContent.php


示例14: search

 public function search()
 {
     $criteria = new CDbCriteria();
     $tmp = 'title_' . Yii::app()->language;
     $criteria->compare('id', $this->id);
     $criteria->compare($tmp, $this->{$tmp}, true);
     if (issetModule('location') && param('useLocation', 1)) {
         $criteria->compare('loc_country', $this->loc_country);
         $criteria->compare('loc_region', $this->loc_region);
         $criteria->compare('loc_city', $this->loc_city);
     } else {
         $criteria->compare('city_id', $this->city_id);
     }
     $criteria->addCondition('owner_id = ' . Yii::app()->user->id);
     if ($this->active === '0' || $this->active) {
         $criteria->addCondition('active = :active');
         $criteria->params[':active'] = $this->active;
     }
     if ($this->owner_active === '0' || $this->owner_active) {
         $criteria->addCondition('owner_active = :active');
         $criteria->params[':active'] = $this->owner_active;
     }
     if ($this->type) {
         $criteria->addCondition('type = :type');
         $criteria->params[':type'] = $this->type;
     }
     if ($this->obj_type_id) {
         $criteria->addCondition('obj_type_id = :obj_type_id');
         $criteria->params[':obj_type_id'] = $this->obj_type_id;
     }
     $criteria->addCondition('active <> :draft');
     $criteria->params['draft'] = Apartment::STATUS_DRAFT;
     $criteria->addInCondition('type', self::availableApTypesIds());
     return new CActiveDataProvider($this, array('criteria' => $criteria, 'sort' => array('defaultOrder' => 'id DESC'), 'pagination' => array('pageSize' => param('userPaginationPageSize', 20))));
 }
开发者ID:alexjkitty,项目名称:estate,代码行数:35,代码来源:UserAds.php


示例15: onValidateId

 protected function onValidateId()
 {
     $id = param("id");
     if (!hasPerm(AUTH_MGR) || is_null(param("id"))) {
         setParam("id", $_SESSION["empId"]);
     }
 }
开发者ID:skyshore2001,项目名称:JDCloud,代码行数:7,代码来源:api_objects.php


示例16: getCreateTime

 public function getCreateTime($format = null)
 {
     if (null === $format) {
         $format = param('formatShortDateTime');
     }
     return date($format, $this->create_time);
 }
开发者ID:jackycgq,项目名称:24beta,代码行数:7,代码来源:Comment.php


示例17: actionIndex

 public function actionIndex()
 {
     if (isFree()) {
         $this->redirect(array('config', 'lang' => param('langToInstall', 'en')));
     }
     $this->render('index');
 }
开发者ID:barricade86,项目名称:raui,代码行数:7,代码来源:MainController.php


示例18: load_from_Request

 /**
  * Load data from Request form fields.
  *
  * @return boolean true if loaded data seems valid.
  */
 function load_from_Request()
 {
     global $Messages, $localtimenow;
     // Group ID
     param('ivc_grp_ID', 'integer');
     param_check_not_empty('ivc_grp_ID', T_('Please select a group'));
     $this->set_from_Request('grp_ID', 'ivc_grp_ID', true);
     // Code
     param('ivc_code', 'string');
     param_check_not_empty('ivc_code', T_('You must provide an invitation code!'));
     param_check_regexp('ivc_code', '#^[A-Za-z0-9\\-_]{3,32}$#', T_('Invitation code must be from 3 to 32 letters, digits or signs "-", "_".'));
     $this->set_from_Request('code', 'ivc_code');
     // Expire date
     if (param_date('ivc_expire_date', T_('Please enter a valid date.'), true) && param_time('ivc_expire_time')) {
         // If date and time were both correct we may set the 'expire_ts' value
         $this->set('expire_ts', form_date(get_param('ivc_expire_date'), get_param('ivc_expire_time')));
     }
     // Source
     param('ivc_source', 'string');
     $this->set_from_Request('source', 'ivc_source', true);
     if (mysql2timestamp($this->get('expire_ts')) < $localtimenow) {
         // Display a warning if date is expired
         $Messages->add($this->ID == 0 ? T_('Note: The newly created invitation code is already expired') : T_('Note: The updated invitation code is already expired'), 'warning');
     }
     return !param_errors_detected();
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:31,代码来源:_invitation.class.php


示例19: load_from_Request

 /**
  * Load data from Request form fields.
  *
  * @return boolean true if loaded data seems valid.
  */
 function load_from_Request()
 {
     // Name
     $tag_name = param('tag_name', 'string', true);
     param_check_regexp('tag_name', '/^[^,]+$/', T_('Tags cannot contain commas.'));
     $this->set('name', $tag_name);
     if ($existing_tag_ID = $this->dbexists('tag_name', $tag_name)) {
         // Other tag already exists with the same name:
         if (empty($this->ID)) {
             // Suggest to edit existing tag for new creating tag
             param_error('tag_name', sprintf(T_('This tag already exists. Do you want to <a %s>edit the existing tag</a>?'), 'href="?ctrl=itemtags&amp;action=edit&amp;tag_ID=' . $existing_tag_ID . '"'));
         } else {
             // Suggest to merge for existing tag
             global $DB, $Messages, $display_merge_tags_form;
             $new_tag_posts = intval($DB->get_var('SELECT COUNT( itag_itm_ID ) FROM T_items__itemtag WHERE itag_tag_ID = ' . $DB->quote($existing_tag_ID)));
             $old_tag_posts = intval($DB->get_var('SELECT COUNT( itag_itm_ID ) FROM T_items__itemtag WHERE itag_tag_ID = ' . $DB->quote($this->ID)));
             // Set this to know to display a confirmation message to merge this tag
             $this->merge_tag_ID = $existing_tag_ID;
             $this->merge_message = sprintf(T_('The previously named "%s" tag (applied to %d posts) will be merged with the existing "%s" tag (already applied to %d posts). Are you sure?'), $this->dget('name'), $old_tag_posts, $tag_name, $new_tag_posts, 'href="?ctrl=itemtags&amp;action=merge&amp;old_tag_ID=' . $this->ID . '&amp;tag_ID=' . $existing_tag_ID . '&amp;' . url_crumb('tag') . '"', 'href="?ctrl=itemtags&amp;action=edit&amp;tag_ID=' . $this->ID . '"');
             // Return FALSE to don't save current changes without confirmation
             return false;
         }
     }
     return !param_errors_detected();
 }
开发者ID:Ariflaw,项目名称:b2evolution,代码行数:30,代码来源:_itemtag.class.php


示例20: search

 public function search()
 {
     $criteria = new CDbCriteria();
     $criteria->compare('title_' . Yii::app()->language, $this->{'title_' . Yii::app()->language}, true);
     $criteria->order = 'sorter ASC';
     return new CActiveDataProvider($this, array('criteria' => $criteria, 'pagination' => array('pageSize' => param('adminPaginationPageSize', 20))));
 }
开发者ID:barricade86,项目名称:raui,代码行数:7,代码来源:ReferenceCategories.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP param_action函数代码示例发布时间:2022-05-15
下一篇:
PHP parallax_get_file函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap