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

PHP options函数代码示例

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

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



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

示例1: __construct

 function __construct($uri = null, $method = null, $params = null)
 {
     $this->server = new Hash();
     $this->server->merge($_SERVER);
     // set uri, method, and params from $_SERVER and $_REQUEST
     $this->uri = $uri ?: $this->server->get('REQUEST_URI', '/');
     $this->params = new Hash();
     $this->params->merge($params ?: $_REQUEST);
     $this->method = $method ?: $this->server->get('REQUEST_METHOD', 'GET');
     $this->method = strtoupper($this->method);
     if ($this->method === 'POST' && options()->get('requestMethodOverride', true)) {
         $method = strtoupper($this->params->get('_method', ''));
         if (in_array($method, array('DELETE', 'GET', 'PUT', 'POST'))) {
             $this->method = $method;
         }
     }
     // strip basePath from uri, if it is set and matches
     $basePath = rtrim(options()->get('requestBasePath', ''), '/');
     if ($basePath && strpos($this->uri, $basePath) === 0) {
         $this->uri = substr($this->uri, strlen($basePath)) ?: '/';
     }
     // split the uri into route and format
     $info = pathinfo($this->uri);
     $this->path = rtrim($info['dirname'], '/') . '/' . $info['filename'];
     if (!empty($info['extension'])) {
         $this->params->format = strtolower($info['extension']);
     } else {
         if (!$this->params->format) {
             $this->params->format = 'html';
         }
     }
     $this->format = $this->params->format;
 }
开发者ID:noonat,项目名称:pipes,代码行数:33,代码来源:request.php


示例2: render

 public function render()
 {
     # make sure we have a template
     if ($this->template === false) {
         throw new TemplateUndefined();
     }
     parent::render();
     # unpack the props
     extract($this->props);
     # trap the buffer
     ob_start();
     # include the template
     require \options('views') . '/' . $this->template . '.' . $this->extension;
     # get the buffer contents
     $parsed = ob_get_contents();
     # clean the buffer
     ob_clean();
     # if there is a layout
     if ($this->layout) {
         # push the content into the layout
         $content_for_layout = $parsed;
         # include the template
         include \options('views') . '/' . $this->layout . "." . $this->extension;
         # get the buffer contents
         $parsed = ob_get_contents();
     }
     # close the output buffer
     ob_end_clean();
     # echo the result
     echo $parsed;
 }
开发者ID:Epictetus,项目名称:vicious,代码行数:31,代码来源:PHTML.php


示例3: login

 public function login($uid = null)
 {
     if (null !== $uid) {
         $this->user->login(models\User::get($uid));
     }
     if ($this->user->isLoggedIn()) {
         $this->_redirect('/blog');
     }
     if ($this->POST) {
         $post = options($_POST);
         $get = options($_GET);
         try {
             // get user object
             $user = models\User::withCredentials(array('username' => (string) $post->username, 'password' => (string) $post->password));
             // log user in(to SessionUser)
             $this->user->login($user);
             // debug direct logged in status
             Session::message('<pre>' . var_export($this->user->isLoggedIn(), 1) . '</pre>');
             // message OK
             Session::success('Alright, alright, alright, you\'re logged in...');
             // back to blog
             return $this->_redirect($post->get('goto', $get->get('goto', 'blog')));
         } catch (\Exception $ex) {
         }
         // message FAIL
         Session::error('Sorry, buddy, that\'s not your username!');
     }
     $messages = Session::messages();
     return get_defined_vars();
 }
开发者ID:rudiedirkx,项目名称:Rudie-on-wheels,代码行数:30,代码来源:userController.php


示例4: process_request

function process_request($ingredients)
{
    $url = NUT_API . urlencode(options($ingredients));
    $context = stream_context_create(array('http' => array('method' => 'GET', 'ignore_errors' => TRUE)));
    $json = file_get_contents($url, 0, $context);
    return json_encode(json_decode($json, true), JSON_PRETTY_PRINT);
}
开发者ID:clintwine,项目名称:nutrition-facts-label,代码行数:7,代码来源:process.php


示例5: load_script

/**
 * Google Analytics snippet from HTML5 Boilerplate
 *
 * Cookie domain is 'auto' configured. See: http://goo.gl/VUCHKM
 * You can enable/disable this feature in functions.php (or lib/setup.php if you're using Sage):
 * add_theme_support('soil-google-analytics', 'UA-XXXXX-Y', 'wp_footer');
 */
function load_script()
{
    $gaID = options('gaID');
    if (!$gaID) {
        return;
    }
    $loadGA = (!defined('WP_ENV') || \WP_ENV === 'production') && !current_user_can('manage_options');
    $loadGA = apply_filters('soil/loadGA', $loadGA);
    ?>
  <script>
    <?php 
    if ($loadGA) {
        ?>
      window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date;
    <?php 
    } else {
        ?>
      (function(s,o,i,l){s.ga=function(){s.ga.q.push(arguments);if(o['log'])o.log(i+l.call(arguments))}
      s.ga.q=[];s.ga.l=+new Date;}(window,console,'Google Analytics: ',[].slice))
    <?php 
    }
    ?>
    ga('create','<?php 
    echo $gaID;
    ?>
','auto');ga('send','pageview')
  </script>
  <?php 
    if ($loadGA) {
        ?>
    <script src="https://www.google-analytics.com/analytics.js" async defer></script>
  <?php 
    }
}
开发者ID:rku4er,项目名称:vafpress-wp,代码行数:41,代码来源:google-analytics.php


示例6: _chain

 public function _chain($type, Closure $event = null, array $args = array())
 {
     $event or $event = function () {
     };
     $chain = static::event($type);
     $chain->first($event);
     return $chain->start($this, options($args));
 }
开发者ID:rudiedirkx,项目名称:Rudie-on-wheels,代码行数:8,代码来源:Object.php


示例7: load_fonts

/**
 * Add requested Google Fonts in head
 *
 * You can enable/disable this feature in functions.php (or lib/setup.php if you're using Sage):
 * add_theme_support(
 *	'solero-google-fonts',
 *	[
 *		'Open Sans' => '400,700,400italic,700italic',
 *		'Noto Sans' => '400,400italic'
 *	]
 * );
 */
function load_fonts()
{
    $fonts = options('fonts');
    if (!$fonts) {
        return;
    }
    $query = '//fonts.googleapis.com/css?family=' . $fonts;
    wp_register_style('solero-google-fonts', $query, [], null);
    wp_enqueue_style('solero-google-fonts');
}
开发者ID:starise,项目名称:solero,代码行数:22,代码来源:google-fonts.php


示例8: autofind_layout

 /**
  * Autodetect the layout
  * Looks for a file named "layout.$this->extension" in the views dir
  */
 protected function autofind_layout()
 {
     if ($this->extension != false) {
         $l = \options('views') . '/layout.' . $this->extension;
         if (file_exists($l)) {
             $this->set_layout('layout');
             return 'layout';
         }
     }
     return false;
 }
开发者ID:Epictetus,项目名称:vicious,代码行数:15,代码来源:AbstractView.php


示例9: context

 public static function context($name, $options = array())
 {
     // set context
     if (is_object($options) && is_callable($options)) {
         static::$contexts[$name] = $options;
     }
     // execute & return context
     if (isset(static::$contexts[$name])) {
         $ctx = static::$contexts[$name];
         return $ctx(get_called_class(), options($options));
     }
 }
开发者ID:rudiedirkx,项目名称:Rudie-on-wheels,代码行数:12,代码来源:Email.php


示例10: options

function options($self, $title, $prefix, $entityName, $withCsvOptions, $withMagmiDelete, $withEnable, $withDefaults, $pruneKeepDefaultValue, $sourceText, $plugin)
{
    $default_rows_for_sets = "attribute_set_name,attribute_code,attribute_group_name\n*,name,General\n*,description,General\n*,short_description,General\n*,sku,General\n*,weight,General\n*,news_from_date,General\n*,news_to_date,General\n*,status,General\n*,url_key,General\n*,visibility,General\n*,country_of_manufacture,General\n*,price,Prices\n*,group_price,Prices\n*,special_price,Prices\n*,special_from_date,Prices\n*,special_to_date,Prices\n*,tier_price,Prices\n*,msrp_enabled,Prices\n*,msrp_display_actual_price_type,Prices\n*,msrp,Prices\n*,tax_class_id,Prices\n*,price_view,Prices\n*,meta_title,Meta Information\n*,meta_keyword,Meta Information\n*,meta_description,Meta Information\n*,image,Images\n*,small_image,Images\n*,thumbnail,Images\n*,media_gallery,Images\n*,gallery,Images\n*,is_recurring,Recurring Profile\n*,recurring_profile,Recurring Profile\n*,custom_design,Design\n*,custom_design_from,Design\n*,custom_design_to,Design\n*,custom_layout_update,Design\n*,page_layout,Design\n*,options_container,Design\n*,gift_message_available,Gift Options";
    if (isset($title)) {
        ?>
<h3><?php 
        echo $title;
        ?>
</h3><?php 
    }
    if ($withEnable) {
        checkbox($self, $prefix, 'enable', true, "Enable {$entityName} import");
        startDiv($self, $prefix, 'enabled', $self->getParam($prefix . ":enable", "on") == "on");
    }
    if ($withCsvOptions) {
        csvOptions($self, $prefix);
    }
    ?>
    <h4>Import behavior</h4>
    <?php 
    if ($withDefaults) {
        text($self, $prefix, 'default_values', "", "Set default values for non-existing columns in {$sourceText} (JSON)");
    }
    if ($prefix == '5B5AAI') {
        textarea($self, $prefix, 'default_rows', $default_rows_for_sets, "Add these attribute associations to given CSV data, '*' for attribute set name  means 'for each attribute set from given CSV' (Format: CSV with titles, spearator ',', enclosure '\"').");
    }
    checkbox($self, $prefix, 'prune', true, "Prune {$entityName}s which are not in {$sourceText} from database");
    startDiv($self, $prefix, 'prune_opts');
    if ($prefix == '5B5ATI' || $prefix == '5B5AAI') {
        checkbox($self, $prefix, 'prune_keep_system_attributes', true, "Dont touch non-user attributes when pruning.");
    }
    text($self, $prefix, 'prune_only', '', "prune only {$entityName}s matching regexp");
    text($self, $prefix, 'prune_keep', $pruneKeepDefaultValue, "additionally, keep following {$entityName}s when pruning, even if not given in {$sourceText} (comma-separated)");
    endDiv($self);
    if ($withMagmiDelete) {
        checkbox($self, $prefix, 'magmi_delete', true, "Delete {$entityName}s marked \"magmi:delete\" = 1");
    }
    checkbox($self, $prefix, 'create', true, "Create {$entityName}s from {$sourceText} which are not in database");
    checkbox($self, $prefix, 'update', true, "Update {$entityName}s from {$sourceText} which are already in database");
    if ($prefix == '5B5ASI') {
        startDiv($self, $prefix, 'attribute_groups');
        options($self, null, '5B5AGI', 'attribute group', false, false, false, false, "General,Prices,Meta Information,Images,Recurring Profile,Design,Gift Options", '"magmi:groups"', $plugin);
        endDiv($self);
    }
    if ($withEnable) {
        endDiv($self);
    }
    javascript($self, $prefix, $withCsvOptions, $plugin);
}
开发者ID:bjoern-tantau,项目名称:magmi-git,代码行数:49,代码来源:functions.php


示例11: __construct

 public function __construct($uri = false, $method = false)
 {
     if ($uri === false) {
         if (array_key_exists('REQUEST_URI', $_SERVER)) {
             $this->uri = $_SERVER['REQUEST_URI'];
         }
     } else {
         $this->uri = $uri;
     }
     if ($method !== false) {
         $this->method = $method;
     }
     if (\options('methodoverride')) {
         $this->method_override();
     }
 }
开发者ID:Epictetus,项目名称:vicious,代码行数:16,代码来源:Request.php


示例12: load_script

/**
 * Google Analytics snippet from HTML5 Boilerplate
 *
 * Cookie domain is 'auto' configured. See: http://goo.gl/VUCHKM
 * You can enable/disable this feature in functions.php (or lib/setup.php if you're using Sage):
 * add_theme_support('solero-google-analytics', 'UA-XXXXX-Y', 'wp_footer');
 */
function load_script()
{
    $gaID = options('gaID');
    if (!$gaID) {
        return;
    }
    $loadGA = (!defined('WP_ENV') || \WP_ENV === 'production') && !current_user_can('manage_options');
    $loadGA = apply_filters('solero/loadGA', $loadGA);
    $cookieGA = true;
    $cookieGA = apply_filters('solero/cookieGA', $cookieGA);
    ?>
	<script>
		<?php 
    if ($loadGA) {
        ?>
			window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date;
		<?php 
    } else {
        ?>
			(function(so,le,r,o){so.ga=function(){so.ga.q.push(arguments);if(le['log'])le.log(r+o.call(arguments))}
			so.ga.q=[];so.ga.o=+new Date;}(window,console,'Google Analytics: ',[].slice))
		<?php 
    }
    ?>
		ga('create','<?php 
    echo $gaID;
    ?>
','auto');
		<?php 
    if (!$cookieGA) {
        ?>
		ga('set', 'anonymizeIp', true);
		<?php 
    }
    ?>
		ga('send','pageview');
	</script>
	<?php 
    if ($loadGA) {
        ?>
		<script src="https://www.google-analytics.com/analytics.js" async defer></script>
	<?php 
    }
}
开发者ID:starise,项目名称:solero,代码行数:51,代码来源:google-analytics.php


示例13: run

function run($options = array())
{
    $options = options()->merge($options);
    $request = request();
    $response = response();
    foreach (routes() as $route) {
        if ($route->matches($request, $matches)) {
            route($route);
            $path = isset($matches['path']) ? $matches['path'] : $request->path;
            $data = $route->run($path, $matches);
            if ($data) {
                $response->write($data);
            }
            if ($options->get('flush', true)) {
                $response->flush();
            }
            return $route;
        }
    }
    return null;
}
开发者ID:noonat,项目名称:pipes,代码行数:21,代码来源:helpers.php


示例14: saveform

     saveform();
     break;
 case "qiangzhisave":
     qiangzhisave();
     break;
 case "addform":
     addform($action);
     break;
 case "qiangzhi":
     qiangzhi($action);
     break;
 case "modify":
     addform($action);
     break;
 case "options":
     options(intval($_GET["site_id"]));
     break;
 case "dell_links":
     dell_links(HtmlReplace($_GET["url"]));
     break;
 case "del":
     $site_id = intval($_GET["site_id"]);
     $db->query("delete from ve123_sites where site_id='" . $site_id . "'");
     break;
 case "add_in_site_link":
     $site_id = $_GET["site_id"];
     echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td width=\"98%\"><iframe src=\"start.php?action=add_in_site_link&site_id=" . $site_id . "\" height=\"450\" width=\"100%\"></iframe></td></tr></table><br>";
     break;
 case "add_all_lry":
     //收录全站
     $site_id = $_GET["site_id"];
开发者ID:tanny2015,项目名称:DataStructure,代码行数:31,代码来源:sites.php


示例15: options

<?php

/**
 * Mailing List Plugin, Furasta.Org
 *
 * @author	Conor Mac Aoidh <[email protected]>
 * @licence	http://furasta.org/licence.txt The BSD Licence
 * @version	1
 */
$Template = Template::getInstance();
$mailing_list_options = options('mailing_list_options');
$page = @$_GET['page'];
switch ($page) {
    case 'options':
        require HOME . '_plugins/Mailing-List/admin/options.php';
        break;
    case 'mail':
    case 'send':
        $conds = array('Subject' => array('name' => $Template->e('mailing_list_subject'), 'required' => true), 'BCC' => array('name' => $Template->e('mailing_list_bcc'), 'required' => true), 'Content' => array('name' => $Template->e('mailing_list_content'), 'required' => true));
        $valid = validate($conds, '#mail-form', 'mail-form-submit');
        if ($page == 'send') {
            require HOME . '_plugins/Mailing-List/admin/send.php';
        } else {
            require HOME . '_plugins/Mailing-List/admin/mail.php';
        }
        break;
    default:
        require HOME . '_plugins/Mailing-List/admin/list.php';
}
开发者ID:letsdodjango,项目名称:furasta-org,代码行数:29,代码来源:index.php


示例16: main_rule

    exit;
}
if (isset($_GET["rulemd5"])) {
    main_rule();
    exit;
}
if (isset($_GET["items-rules"])) {
    items();
    exit;
}
if (isset($_GET["diclaimers-rule"])) {
    disclaimer_rule();
    exit;
}
if (isset($_GET["options"])) {
    options();
    exit;
}
if (isset($_POST["mailfrom"])) {
    filehosting_rule_add();
    exit;
}
if (isset($_POST["del-zmd5"])) {
    autocompress_rule_delete();
    exit;
}
popup();
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:31,代码来源:mimedefang.filehosting.php


示例17: options

            <select name="birthMount">
                <option value=""> Select </option>
                <?php 
echo options([JANUARY => 'JANUARY', FEBRUARY => 'FEBRUARY', MARCH => 'MARCH', APRIL => 'APRIL'], $birth_mount);
?>
            </select>
        </span>
        <span>
            <select name="birthDay" id="birthDays">
                <option value=""> Select </option>
                <?php 
echo options([d1 => '1', d2 => '2', d3 => '3', d4 => '4', d5 => '5', d6 => '6', d7 => '7'], $birth_day);
?>
            </select>
        </span>
        <span>
            <select name="birthYear" id="">
                <option  value=""> Select </option>
                <?php 
echo options([y1 => '1909', y2 => '1908', y3 => '1907', y4 => '1906', y5 => '1905', y6 => '1904', y7 => '1903', y8 => '1902', y9 => '1901', y10 => '1900'], $birth_year);
?>
            </select>
        </span>
    </span>
    <br>
    <span>
        <button type="submit">Add Employee</button>
    </span>
</form>
</body>
</html>
开发者ID:Just-Man,项目名称:PHP,代码行数:31,代码来源:get.php


示例18: options

                value="<?php 
echo $search_to_date;
?>
" pattern="\d{4}\-\d{2}\-\d{2}" />
            
            <label class="control-label"> &nbsp; Tallers favorits ?</label> 
            <input type="checkbox" name="favourite" value="y" 
                 <?php 
echo !empty($search_favourite) && $search_favourite !== 'n' ? ' checked ' : '';
?>
 > 
            
            <label class="control-label"> &nbsp; Per edats </label>
            <select name="search_ages[]" class="form-control" multiple>
              <?php 
options($ages, $search_ages);
?>
            </select>   


     </div>


    
    <input type="hidden" name="page" value="1"/>    
    <input type="hidden" name="limit" id ="list-limit-id" value="<?php 
echo $limit;
?>
"/>
    <input type="hidden" name="expanded" id="list-expanded-id" value="<?php 
echo $expanded;
开发者ID:JordiCruells,项目名称:mtbd,代码行数:31,代码来源:include_search_workshops.php


示例19: imports

<?php

require_once 'functions.php';
?>


<div class="plugin_description">
	This plugin imports (inserts, updates, deletes) a list of attribute sets before the products will be updated.
</div>
<?php 
options($this, 'Attribute import options', '5B5ATI', 'attribute', true, true, true, true, 'category_ids,country_of_manufacture,created_at,custom_design,custom_design_from,custom_design_to,custom_layout_update,description,gallery,gift_message_available,group_price,has_options,image,image_label,is_recurring,links_exist,links_purchased_separately,links_title,media_gallery,meta_description,meta_keyword,meta_title,minimal_price,msrp,msrp_display_actual_price_type,msrp_enabled,name,news_from_date,news_to_date,old_id,options_container,page_layout,price,price_type,price_view,recurring_profile,required_options,samples_title,shipment_type,short_description,sku,sku_type,small_image,small_image_label,special_from_date,special_price,special_to_date,status,tax_class_id,thumbnail,thumbnail_label,tier_price,updated_at,url_key,url_path,visibility,weight,weight_type', 'CSV', $this->_plugin);
options($this, 'Attribute set import options', '5B5ASI', 'attribute set', true, true, true, true, 'Default', 'CSV', $this->_plugin);
options($this, 'Attribute association import options', '5B5AAI', 'attribute association', true, true, true, true, 'Default', 'CSV', $this->_plugin);
开发者ID:oitmain,项目名称:magmi-git,代码行数:13,代码来源:options_panel.php


示例20: addform

        addform($action);
        break;
    case 'modify':
        addform($action);
        break;
    case 'update_qp':
        update_qp(intval($_GET['site_id']));
        break;
    case 'update_all_qp':
        update_all_qp();
        break;
    case 'links_to_sites':
        links_to_sites();
        break;
    case 'options':
        options(intval($_GET['site_id']));
        break;
    case 'dell_links':
        dell_links(HtmlReplace($_GET['url']));
        break;
    case 'update_all_site_id':
        update_all_site_id();
        break;
    case 'del':
        $site_id = intval($_GET['site_id']);
        $db->query("delete from ve123_sites where site_id='" . $site_id . "'");
        break;
    case 'dolistform':
        dolistform();
        break;
}
开发者ID:tanny2015,项目名称:DataStructure,代码行数:31,代码来源:sites.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP options_allowed_values函数代码示例发布时间:2022-05-15
下一篇:
PHP optionlist函数代码示例发布时间: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