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

PHP setting函数代码示例

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

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



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

示例1: updateHomesteadConfig

 /**
  * Updates the homestead.yaml file to include the new folder.
  *
  * @param $group
  */
 protected function updateHomesteadConfig($group)
 {
     $config = $this->yaml->parse($this->filesystem->get(setting('userDir') . '/.homestead/Homestead.yaml'));
     // Add the group to the folder config
     $config['folders'][] = ['map' => $group->starting_path, 'to' => vagrantDirectory($group->starting_path)];
     app(Homestead::class)->saveHomesteadConfig($config);
 }
开发者ID:NukaCode,项目名称:dasher,代码行数:12,代码来源:Create.php


示例2: smarty_block_registration_form

/**
* Registration Form Template Plugin
*
* Assists in the creation of registration forms
*
* @param string $return The relative or absolute URL to return to after registering
*/
function smarty_block_registration_form($params, $tagdata, &$smarty, &$repeat)
{
    if (!isset($params['var'])) {
        show_error('You must specify a "var" parameter for template {registration_form} calls.  This parameter specifies the variable name for the returned array.');
    } else {
        $variables = array();
        // get return URL
        if (isset($params['return']) and !empty($params['return'])) {
            $variables['return'] = query_value_encode($params['return']);
        } else {
            $variables['return'] = '';
        }
        // form action
        $variables['form_action'] = site_url('users/post_registration');
        if (setting('ssl_certificate') == '1') {
            $variables['form_action'] = secure($variables['form_action']);
        }
        // populated values
        $variables['first_name'] = $smarty->CI->input->post('firstname');
        $variables['last_name'] = $smarty->CI->input->post('last_name');
        $variables['email'] = $smarty->CI->input->post('email');
        $variables['username'] = $smarty->CI->input->post('username');
        $custom_fields = $smarty->CI->user_model->get_custom_fields(array('registration_form' => TRUE, 'not_in_admin' => TRUE));
        $variables['custom_fields'] = $custom_fields;
        if (is_array($custom_fields)) {
            foreach ($custom_fields as $field) {
                $variables[$field['name']] = $smarty->CI->input->post($field['name']);
            }
        }
        $smarty->assign($params['var'], $variables);
        echo $tagdata;
    }
}
开发者ID:Rotron,项目名称:hero,代码行数:40,代码来源:block.registration_form.php


示例3: contact

 /**
  * Send email for contact form
  *
  * @param array $data
  */
 public function contact(array $data)
 {
     $email = setting('email.support');
     $subject = 'Contact: ' . $data['subject'];
     $view = 'emails.contact';
     $this->send($view, $data, $subject, $email);
 }
开发者ID:vjaykoogu,项目名称:smile-media-laravel,代码行数:12,代码来源:UserMailer.php


示例4: unexpire

 public function unexpire($register_key)
 {
     $this->_database->set('timeout', date('Y-m-d H:i:s', strtotime('+' . setting('Register.Email Activation Expire') . ' minutes')));
     $this->_database->set('expired', 0);
     $this->_database->where('register_key', $register_key);
     return $this->_database->update($this->table);
 }
开发者ID:ProjectOrangeBox,项目名称:register,代码行数:7,代码来源:A_register_model.php


示例5: output_admin

    /**
     * Output Admin
     *
     * Returns the field with it's <label> in an <li> suitable for the admin forms.
     *
     * @return string $return The HTML to be included in a form
     */
    function output_admin()
    {
        $attributes = $this->output_shared();
        $this->help = 'Maximum filesize for web upload: ' . setting('upload_max') . '.  ' . $this->help;
        $help = '<div class="help">' . $this->help . '</div>';
        // create text that appears after the upload box
        $after_box = '<input type="button" class="button" onclick="javascript:$(\'#ftp_notes_' . $this->name . '\').modal(); void(0);" name="" value="Upload via FTP" />';
        // show current file
        if (!empty($this->value)) {
            if (in_array(file_extension($this->value), array('jpg', 'jpeg', 'gif', 'bmp', 'png'))) {
                $this->CI->load->helper('image_thumb');
                $after_box .= '<br /><a href="' . site_url($this->value) . '"><img style="margin-left: 150px" src="' . image_thumb(FCPATH . $this->value, 100, 100) . '" alt="preview" /></a>';
            } else {
                $after_box .= '&nbsp;&nbsp;&nbsp;<a href="' . site_url($this->value) . '">current file</a>';
            }
            $after_box .= '<br /><input style="margin-left: 150px" type="checkbox" name="delete_file_' . $this->name . '" value="1" /> <span style="font-style: italic; color: #ff6464">Delete current ' . $this->label . '</span>';
        }
        // build HTML
        // we can track an already-uploaded filename with a hidden field so, if we
        // don't have a new upload, we stick with the file we already have
        $return = '<li>
						<label for="' . $this->name . '">' . $this->label . '</label>
						<input type="hidden" name="' . $this->name . '_uploaded" value="' . $this->value . '" />
						<input type="hidden" name="' . $this->name . '_ftp" value="" />
						<input ' . $attributes . ' /> ' . $after_box . '
						' . $help . '
						
						<!-- hidden modal window for assigning FTP filenames -->
							<div class="modal" style="height:200px" id="ftp_notes_' . $this->name . '">
							<script type="text/javascript">
								$(document).ready(function() {
									$(\'input[name="' . $this->name . '_ftp_input"]\').keyup(function () {
										$(\'input[name="' . $this->name . '_ftp"]\').val($(this).val());
									});
								});
							</script>
							<h3>Upload File via FTP</h3>
								<ul class="form">
									<li>
										To upload your file via FTP, follow the directions below:
									</li>
									<li>
										<b>1)</b> Connect to your FTP server with your favourite <a class="tooltip" title="An FTP client, such as \'FileZilla\', is an application you download on your computer that connects to FTP server and uploads/downloads files." href="javascript:void(0)">FTP client</a>.
									</li>
									<li>
										<b>2)</b> Upload your file to <span class="code">' . $this->upload_directory . '</span>.
									</li>
									<li>
										<b>3)</b> Enter your uploaded filename here: <input type="text" name="' . $this->name . '_ftp_input" /> (e.g., "myfile.pdf").
									</li>
									<li>
										<b>4)</b> Close this window
									</li>
								</ul>
							</div>
						<!-- end hidden modal window -->
						
					</li>';
        return $return;
    }
开发者ID:Rotron,项目名称:hero,代码行数:67,代码来源:file_upload.php


示例6: get_variables

 public function get_variables($extra = [])
 {
     ci()->load->model('c_snippet_model');
     $variables_set_b = setting('paths');
     $variables_set_a = $this->c_snippet_model->catalog('name', 'value');
     return array_merge($variables_set_b, $variables_set_a, ['base_url' => trim(base_url(), '/'), 'year' => date('Y')], (array) $extra);
 }
开发者ID:ProjectOrangeBox,项目名称:email-templates,代码行数:7,代码来源:O_email_template_model.php


示例7: saveNew

 /**
  * Saves a new image
  * @param string $imageName
  * @param string $imageData
  * @param string $type
  * @param int $uploadedTo
  * @return Image
  * @throws ImageUploadException
  */
 private function saveNew($imageName, $imageData, $type, $uploadedTo = 0)
 {
     $storage = $this->getStorage();
     $secureUploads = setting('app-secure-images');
     $imageName = str_replace(' ', '-', $imageName);
     if ($secureUploads) {
         $imageName = str_random(16) . '-' . $imageName;
     }
     $imagePath = '/uploads/images/' . $type . '/' . Date('Y-m-M') . '/';
     if ($this->isLocal()) {
         $imagePath = '/public' . $imagePath;
     }
     while ($storage->exists($imagePath . $imageName)) {
         $imageName = str_random(3) . $imageName;
     }
     $fullPath = $imagePath . $imageName;
     try {
         $storage->put($fullPath, $imageData);
         $storage->setVisibility($fullPath, 'public');
     } catch (Exception $e) {
         throw new ImageUploadException('Image Path ' . $fullPath . ' is not writable by the server.');
     }
     if ($this->isLocal()) {
         $fullPath = str_replace_first('/public', '', $fullPath);
     }
     $imageDetails = ['name' => $imageName, 'path' => $fullPath, 'url' => $this->getPublicUrl($fullPath), 'type' => $type, 'uploaded_to' => $uploadedTo];
     if (user()->id !== 0) {
         $userId = user()->id;
         $imageDetails['created_by'] = $userId;
         $imageDetails['updated_by'] = $userId;
     }
     $image = Image::forceCreate($imageDetails);
     return $image;
 }
开发者ID:ssddanbrown,项目名称:bookstack,代码行数:43,代码来源:ImageService.php


示例8: index

 function index()
 {
     require APPPATH . 'modules/twitter/libraries/twitteroauth.php';
     /* If the oauth_token is old redirect to the connect page. */
     if ($this->input->get('oauth_token') && $this->session->userdata('twitter_oauth_token') !== $this->input->get('oauth_token')) {
         return redirect('admincp/twitter');
     }
     /* Create TwitteroAuth object with app key/secret and token key/secret from default phase */
     $connection = new TwitterOAuth(setting('twitter_consumer_key'), setting('twitter_consumer_secret'), $this->session->userdata('twitter_oauth_token'), $this->session->userdata('twitter_oauth_token_secret'));
     /* Request access tokens from twitter */
     $access_token = $connection->getAccessToken($this->input->get('oauth_verifier'));
     /* Save the access tokens. Normally these would be saved in a database for future use. */
     $this->settings_model->update_setting('twitter_oauth_token', $access_token['oauth_token']);
     $this->settings_model->update_setting('twitter_oauth_token_secret', $access_token['oauth_token_secret']);
     /* Remove no longer needed request tokens */
     $this->session->unset_userdata('twitter_oauth_token');
     $this->session->unset_userdata('twitter_oauth_token_secret');
     /* If HTTP response is 200 continue otherwise send to connect page to retry */
     if (200 == $connection->http_code) {
         $this->notices->SetNotice('OAuthorization retrieved successfully.');
         return redirect('admincp/twitter');
     } else {
         $this->notices->SetError('Error making connection in OAuth callback.');
         return redirect('admincp/twitter');
     }
 }
开发者ID:josev814,项目名称:hero,代码行数:26,代码来源:oauth_callback.php


示例9: getServerId

 public function getServerId()
 {
     if (!setting('cdn_enabled')) {
         return 0;
     }
     return 1;
 }
开发者ID:mepsteinj,项目名称:phpfox-amazons3,代码行数:7,代码来源:CDN.php


示例10: checkout

 public function checkout(Adtype $adtype, AdtypePurchaseRequest $request)
 {
     $user = $this->user;
     $quantity = $request->get('quantity');
     $transaction = ['gatewayId' => $request->get('gateway'), 'userId' => $user->id, 'command' => '\\ZEDx\\Jobs\\purchaseAdtype', 'item' => ['id' => $adtype->id, 'amount' => number_format($adtype->price * $quantity, 2, '.', ''), 'name' => 'Annonce ' . $adtype->title, 'description' => 'Annonce ' . $adtype->title, 'currency' => setting('currency'), 'quantity' => $quantity]];
     Payment::purchase($transaction);
 }
开发者ID:zedx,项目名称:core,代码行数:7,代码来源:AdtypeService.php


示例11: index

 function index()
 {
     // are we doing a search?
     $searching = FALSE;
     $query = FALSE;
     $pagination = FALSE;
     $results = FALSE;
     $num_results = FALSE;
     $title = 'Search ' . setting('site_name');
     if ($this->input->get('q', TRUE) != FALSE) {
         // have we waited long enough before searches?
         if (setting('search_delay') != 0 and $this->session->userdata('last_search') != FALSE and time() - $this->session->userdata('last_search') < setting('search_delay')) {
             die(show_error('You must wait ' . setting('search_delay') . ' seconds between searches.  <a href="javascript:location.reload(true)">Refresh and try again</a>.'));
         }
         $searching = TRUE;
         $query = $this->input->get('q', TRUE);
         $this->load->library('search/search_results');
         $page = $this->input->get('page') ? $this->input->get('page') : 0;
         $results = $this->search_results->search($query, $page);
         $num_results = $this->search_results->get_total_results();
         $pagination = $this->search_results->get_pagination(site_url('search/?q=' . urlencode($query)));
         $title = 'Search Results for "' . $query . '"';
         // record latest search time
         $this->session->set_userdata('last_search', time());
     }
     // display
     $this->smarty->assign('searching', $searching);
     $this->smarty->assign('query', $query);
     $this->smarty->assign('pagination', $pagination);
     $this->smarty->assign('num_results', $num_results);
     $this->smarty->assign('results', $results);
     $this->smarty->assign('title', $title);
     return $this->smarty->display('search.thtml');
 }
开发者ID:Rotron,项目名称:hero,代码行数:34,代码来源:search.php


示例12: sendMailToUser

 /**
  * Send mail to user.
  *
  * @param Ad      $ad
  * @param Request $request
  *
  * @return bool
  */
 protected function sendMailToUser(Ad $ad, BaseRequest $request)
 {
     $mailer = new AdMail();
     $dataSubject = ['ad_title' => $ad->content->title, 'website_title' => setting()->website_title];
     $dataMessage = ['message' => $request->message, 'sender_name' => $request->name, 'sender_email' => $request->email, 'sender_phone' => $request->phone, 'ad_title' => $ad->content->title, 'website_title' => setting()->website_title, 'ad_url' => route('ad.show', [$ad->id, str_slug($ad->content->title)])];
     return $mailer->user()->contactUser($ad->user, ['data' => $dataMessage], $dataSubject);
 }
开发者ID:zedx,项目名称:core,代码行数:15,代码来源:AdService.php


示例13: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     $notifications = Notification::visible()->recents();
     $notifications = $this->filterNotificationsByDateRange($request, $notifications)->paginate(20);
     $currency = setting('currency');
     return view_backend('notification.index', compact('notifications', 'currency'));
 }
开发者ID:zedx,项目名称:core,代码行数:12,代码来源:NotificationController.php


示例14: index

 function index()
 {
     $this->load->library('custom_fields/form_builder');
     $shortname = $this->form_builder->add_field('text')->name('disqus_shortname')->label('Disqus Shortname')->validators(array('alpha_numeric', 'trim'))->value(setting('disqus_shortname'))->help('Don\'t have a shortname?  Register your site at <a href="http://www.disqus.com">Disqus</a>.')->required(TRUE);
     $data = array('form_title' => 'Disqus Configuration', 'form_action' => site_url('admincp/disqus/post_config'), 'form' => $this->form_builder->output_admin(), 'form_button' => 'Save Configuration', 'disqus_shortname' => setting('disqus_shortname'));
     $this->load->view('generic', $data);
 }
开发者ID:josev814,项目名称:hero,代码行数:7,代码来源:admincp.php


示例15: indexAction

 public function indexAction()
 {
     if (setting('application', 'Refresh Profile in Dashboard')) {
         $this->auth->refresh_userdata();
     }
     $this->page->build();
 }
开发者ID:galdiolo,项目名称:theme-orange,代码行数:7,代码来源:DashboardController.php


示例16: update

 /**
  * Update setting items.
  *
  * @param $inputs
  */
 public function update($inputs)
 {
     foreach ($inputs as $key => $value) {
         setting()->set($key, $value);
     }
     setting()->update();
 }
开发者ID:forehalo,项目名称:materialize-blog,代码行数:12,代码来源:AdminRepository.php


示例17: default

 public function default()
 {
     $default = ['limit' => 1, 'level' => 0];
     $this->merge_defaults($default);
     ci()->load->model('c_page_model');
     /* get the page model table prefix so this will be cleared when the model is flushed */
     $model_cache_prefix = ci()->c_page_model->get_cache_prefix();
     /* create our cache key using that prefix */
     $cache_key = $model_cache_prefix . '.menu.special.catalog';
     /* do we have this cached? */
     if (!($data = ci()->cache->get($cache_key))) {
         $records = ci()->c_page_model->get_menus($this->option('level'), $this->option('limit'));
         $data = '<ul class="nav navbar-nav">';
         foreach ($records as $idx => $rec) {
             $record->idx = $idx;
             if ($rec->in_menu) {
                 $url = $rec->url == '/' . setting('cms-page.Home Page', 'home-page') ? '/' : $rec->url;
                 $data .= '<li><a href="' . str_replace('*', '', $url) . '">' . $rec->title . '</a></li>';
             }
         }
         $data .= '</ul>';
         ci()->cache->save($cache_key, $data);
     }
     return $data;
 }
开发者ID:ProjectOrangeBox,项目名称:cms-page,代码行数:25,代码来源:Lex_menu.php


示例18: nav

 public static function nav($left_menu = null, $right_menu = null, $filter_empty = true)
 {
     $hidden_on = setting('Orange Theme', 'Hidden Menubar On');
     $left_root_menu = $right_menu ? $right_menu : setting('Orange Theme', 'Backend Left Menu', 1);
     $right_root_menu = $left_menu ? $left_menu : setting('Orange Theme', 'Backend Right Menu', 2);
     /* hidden on must contain something */
     $hidden_on = empty($hidden_on) ? '*ALL*' : $hidden_on;
     /*
     get all the menus this user has access to in parent / child order
     this is cached by the model based on the user access record ids
     */
     $menus = ci()->o_menubar_model->get_menus_ordered_by_parent_ids(array_keys(ci()->user->access));
     /* now we build the bootstrap menubar */
     $nav = '';
     if (!empty($hidden_on) && ci()->page->data('hide_menubar') !== true) {
         if (!preg_match('@,' . str_replace('*', '[^,]*', $hidden_on) . '@', ',/' . ci()->uri->uri_string(), $matches)) {
             $navbar = setting('Orange Themer', 'NavBar Inverse');
             $navbar = !empty($navbar) ? $navbar : 'inverse';
             $nav .= '<nav class="navbar navbar-' . $navbar . ' navbar-fixed-top">';
             $nav .= '<div class="container">';
             $nav .= '<div class="navbar-header"><button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">';
             $nav .= '<span class="sr-only">Toggle</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button>';
             $nav .= '</div><div id="navbar" class="navbar-collapse collapse"><ul class="nav navbar-nav">';
             $nav .= self::build('left', $left_root_menu, $menus, $filter_empty);
             $nav .= '</ul><ul class="nav navbar-nav navbar-right">';
             $nav .= self::build('right', $right_root_menu, $menus, $filter_empty);
             $nav .= '</ul></div></div></nav>';
         }
     }
     /* here you go! */
     return $nav;
 }
开发者ID:dmyers2004,项目名称:theme-orange,代码行数:32,代码来源:Bootstrap_menu.php


示例19: get_backend_setting

/**
 * Queries the database settings table for a particular setting, and returns its value
/**/
function get_backend_setting($setting, $host = null)
{
    if (is_null($host)) {
        $host = '%';
    }
    return setting($setting, $host);
}
开发者ID:antonyraj15411,项目名称:mythweb,代码行数:10,代码来源:utils.php


示例20: indexAction

 /**
  * Ticket listing.
  */
 public function indexAction()
 {
     // Only get the current projects tickets
     $tickets = ticketQuery()->where('t.project_id = ?')->setParameter(0, $this->currentProject['id']);
     // Sort tickets by the projects sorting setting or by the users selection
     $this->sortTickets($tickets);
     // Filter tickets
     $filter = new TicketFilterQuery($tickets, $this->getFilters());
     $queryString = $filter->query;
     // Paginate tickets
     $pagination = new Pagination(Request::$query->get('page', 1), setting('tickets_per_page'), $tickets->execute()->rowCount(), $filter->query);
     if ($pagination->paginate) {
         $tickets->setFirstResult($pagination->limit);
         $tickets->setMaxResults(setting('tickets_per_page'));
     }
     // Fetch all tickets
     $tickets = $tickets->execute()->fetchAll();
     return $this->respondTo(function ($format) use($filter, $tickets, $pagination) {
         if ($format == 'html') {
             return $this->render('ticket_listing/index.phtml', ['filters' => $filter->filters, 'columns' => $this->getColumns(), 'tickets' => $tickets, 'pagination' => $pagination]);
         } elseif ($format == 'json') {
             return $this->jsonResponse(['page' => (int) $pagination->page, 'total_pages' => (int) $pagination->totalPages, 'filters' => $filter->filters, 'tickets' => $tickets]);
         }
     });
 }
开发者ID:nirix,项目名称:traq,代码行数:28,代码来源:TicketListing.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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