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


PHP YDConfig::get方法代码示例

本文整理汇总了PHP中YDConfig::get方法的典型用法代码示例。如果您正苦于以下问题:PHP YDConfig::get方法的具体用法?PHP YDConfig::get怎么用?PHP YDConfig::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在YDConfig的用法示例。


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

示例1: get

 /**
  *	@returns	The current locale.
  */
 function get()
 {
     // Set the default locale
     YDConfig::set(YD_LOCALE_KEY, 'en', false);
     // Return the setting
     return strtolower(YDConfig::get(YD_LOCALE_KEY));
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:10,代码来源:YDLocale.php

示例2: actionDefault

 function actionDefault()
 {
     // Set some variables
     YDConfig::set('MyConfigVar1', 'value cfg1');
     YDConfig::set('MyConfigVar2', 'value cfg2');
     YDConfig::set('MyConfigVar3', 'value cfg3');
     // Get the values
     YDDebugUtil::dump(YDConfig::get('MyConfigVar1'), 'get - MyConfigVar1');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar2'), 'get - MyConfigVar2');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar3'), 'get - MyConfigVar3');
     // Check if the variables exist or not
     YDDebugUtil::dump(YDConfig::exists('MyConfigVar1'), 'exists - MyConfigVar1');
     YDDebugUtil::dump(YDConfig::exists('MyConfigVar2'), 'exists - MyConfigVar2');
     YDDebugUtil::dump(YDConfig::exists('MyConfigVar3'), 'exists - MyConfigVar3');
     // Check an unexisting variable
     YDDebugUtil::dump(YDConfig::exists('xx'), 'exists - xx');
     // Set some variables, not overriding existing values
     YDConfig::set('MyConfigVar1', 'value cfg1 changed', false);
     YDConfig::set('MyConfigVar2', 'value cfg2 changed', false);
     YDConfig::set('MyConfigVar3', 'value cfg3 changed', false);
     // Get the values (should be unchanged)
     YDDebugUtil::dump(YDConfig::get('MyConfigVar1'), 'get - MyConfigVar1 - changed1');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar2'), 'get - MyConfigVar2 - changed1');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar3'), 'get - MyConfigVar3 - changed1');
     // Set some variables, overriding existing values
     YDConfig::set('MyConfigVar1', 'value cfg1 changed', true);
     YDConfig::set('MyConfigVar2', 'value cfg2 changed', true);
     YDConfig::set('MyConfigVar3', 'value cfg3 changed', true);
     // Get the values (should be changed)
     YDDebugUtil::dump(YDConfig::get('MyConfigVar1'), 'get - MyConfigVar1 - changed2');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar2'), 'get - MyConfigVar2 - changed2');
     YDDebugUtil::dump(YDConfig::get('MyConfigVar3'), 'get - MyConfigVar3 - changed2');
     // Dump the contents of YDConfig
     YDConfig::dump();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:35,代码来源:config.php

示例3: actionDefault

 function actionDefault()
 {
     // Create the form
     $form = new YDForm('form1');
     $form->registerFilter('reverse', 'strrev');
     $form->setDefaults(array('txt2' => 'First text', 'txt3' => "2\nlines", 'hid1' => 'me hidden', 'chk1' => 'x', 'chk2' => false, 'sel1' => 2));
     $text =& $form->addElement('text', 'txt1', 'Enter text 1:');
     $text->_label = 'new label for txt1';
     $form->addElement('text', 'txt2', 'Enter text 2:', array('class' => 'textInputClass', 'name' => 'x'));
     $form->addElement('textarea', 'txt3', 'Enter text 2:');
     $form->addElement('textareacounter', 'txtcounter_1', 'Textarea counter 1', array(), array('maxlength' => 10, 'before' => ' (', 'after' => ' characters remaining)'));
     $form->addElement('textareacounter', 'txtcounter_2', 'Textarea counter 2');
     $form->addElement('radio', 'rad1', 'Select a value 1:', array(), array(1 => 'een', 2 => 'twee'));
     $form->addElement('radio', 'rad2', 'Select a value 2:', array(), array(1 => 'een<br/>', 2 => 'twee'));
     $form->addElement('hidden', 'hid1', '');
     $form->addElement('hidden', 'hid2', '', array(), 'i am also hidden');
     $form->addElement('image', 'img1', '', array(), 'http://www.scripting.com/images/xml.gif');
     $form->addElement('password', 'pas1', 'Enter your password');
     $form->addElement('bbtextarea', 'bbt1', 'Enter your BBCode');
     $form->addElement('checkbox', 'chk1', 'Select me please');
     $form->addElement('checkbox', 'chk2', 'Select me please');
     $form->addElement('select', 'sel1', 'Select an option:', array(), array(1 => 'een', 2 => 'twee'));
     $form->addElement('span', 'span1', 'This is a span. The next element is an image (img).');
     $form->addElement('img', 'img2', 'http://www.scripting.com/images/xml.gif');
     $form->addElement('file', 'fil1', 'Select an file:');
     $form->addElement('submit', 'cmd1', 'Send');
     $form->addElement('reset', 'res1', 'Reset');
     $form->addFilter('__ALL__', 'upper');
     $form->addFilter('txt1', 'trim');
     $form->addFilter('txt2', 'reverse');
     $form->addRule('txt1', 'required', 'txt1 is required');
     $form->addRule('chk2', 'exact', 'chk2 is required', 1);
     $form->addFormRule(array(&$this, 'formrule'), 'txt1 is required');
     if (YDConfig::get('YD_DEBUG') == 1 || YDConfig::get('YD_DEBUG') == 2) {
         YDDebugUtil::dump($form->_regElements, 'Registered elements');
         YDDebugUtil::dump($form->_regRules, 'Registered rules');
         YDDebugUtil::dump($form->_regFilters, 'Registered filters');
         YDDebugUtil::dump($form->_filters, 'Filters');
         YDDebugUtil::dump($form->_rules, 'Rules');
         YDDebugUtil::dump($form->_formrules, 'Form Rules');
         YDDebugUtil::dump($form->getValue('txt1'), 'txt1');
         YDDebugUtil::dump($form->getValue('txt2'), 'txt2');
         YDDebugUtil::dump($_POST, '$_POST');
         YDDebugUtil::dump($_FILES, '$_FILES');
         YDDebugUtil::dump($form->toArray());
     }
     if ($form->validate()) {
         YDDebugUtil::dump($form->getModifiedValues(), 'Form modified values');
         YDDebugUtil::dump($form->getValues(), 'Form values');
     } else {
         $form->display();
     }
     // Create the form
     $form2 = new YDForm('form2');
     $form2->setDefaults(array('txt1' => 'First text'));
     $form2->addElement('text', 'txt1', 'Enter text 1:');
     $form2->addElement('text', 'txt2', 'Enter text 2:');
     $form2->addElement('submit', 'cmd1', 'Send');
     $form2->display();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:60,代码来源:form2.php

示例4: actionDefault

 function actionDefault()
 {
     // Get the ID from the query string
     $id = $this->getIdFromQS();
     // If there is nothing, show the list
     if ($id == -1) {
         // Get the count and number of requests
         $requests_count = $this->weblog->getBadBehaviorRequestsCount();
         $requests = $this->weblog->getBadBehaviorPostRequests();
         // Get the pagesize and current page from the URL
         $page = @$_GET['page'];
         // Create the YDRecordSet object
         $requests = new YDRecordSet($requests, $page, YDConfig::get('YD_DB_DEFAULTPAGESIZE', 20));
         // Assign it to the template
         $this->tpl->assign('requests_count', $requests_count);
         $this->tpl->assign('requests', $requests);
     } else {
         // Get the request data
         $request = $this->weblog->getBadBehaviorRequestById($id);
         // Redirect if nothing found
         if (!$request) {
             $this->redirectToAction();
         }
         // Add it to the template
         $this->tpl->assign('request', $request);
     }
     // Display the template
     $this->display();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:29,代码来源:bad_behavior.php

示例5: actionDefault

 function actionDefault()
 {
     // Get the filter
     $filter = 'no_spam';
     if (isset($_GET['filter']) && strtolower($_GET['filter']) == 'spam') {
         $filter = 'spam';
     }
     // Get the ID from the query string
     $id = $this->getIdFromQS();
     // If there is something, set the defaults
     if ($id != -1) {
         // Get the list of comments
         $comments = $this->weblog->getComments($id, 'CREATED DESC');
         // Get the item details
         $item = $this->weblog->getItemById($id);
         $this->tpl->assign('item', $item);
     } else {
         // Get the list of comments
         if ($filter == 'no_spam') {
             $comments = $this->weblog->getComments(null, 'CREATED DESC');
         } else {
             $comments = $this->weblog->getComments(null, 'CREATED DESC', -1, -1, false, true);
         }
     }
     // Get the pagesize and current page from the URL
     $page = @$_GET['page'];
     // Create the YDRecordSet object
     $comments = new YDRecordSet($comments, $page, YDConfig::get('YD_DB_DEFAULTPAGESIZE', 20));
     // Assign it to the template
     $this->tpl->assign('comments', $comments);
     $this->tpl->assign('filter', $filter);
     // Display the template
     $this->display();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:34,代码来源:comments.php

示例6: module

 /**
  *  This static function returns an YDCMStatistics module
  *
  *  @returns    an module object
  */
 function module($name)
 {
     // include lib
     // TODO: check if name is a valid lib name
     require_once YDConfig::get('YD_DBOBJECT_PATH') . '/' . $name . '.php';
     // return class
     return new $name();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:13,代码来源:YDCMStatistics.php

示例7: actionThumbnailSmall

 function actionThumbnailSmall()
 {
     // Get the image name
     if (!isset($_GET['id'])) {
         die('No image selected.');
     }
     // Create a new image object
     $img = new YDFSImage(YDConfig::get('dir_uploads', '../uploads') . '/' . $_GET['id']);
     // Output the thumbnail
     $img->outputThumbnail(48, 48);
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:11,代码来源:YDWeblogAdminRequest.php

示例8: actionShowLog

 function actionShowLog()
 {
     $file = new YDFSFile(YDConfig::get('YD_LOG_FILE'));
     $data = $file->getContents();
     if (substr($data, 0, 5) == '<?xml') {
         header('Content-type: text/xml');
     } else {
         header('Content-type: text/plain');
     }
     echo $data;
     die;
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:12,代码来源:logging.php

示例9: getFormPage

 /**
  *  This function returns the page form (form admin edition)
  *
  *  @returns    YDForm object
  */
 function getFormPage()
 {
     YDInclude('YDForm.php');
     // get template and language object
     $templates = YDCMComponent::module('YDCMTemplates');
     $languages = YDCMComponent::module('YDCMLanguages');
     // create access options
     $access = array(0 => t('public'), 1 => t('private'));
     // create 'template pack' options
     $template_pack = array(1 => t('use templatepack') . ' (' . $templates->template_pack() . ')', 0 => t('use custom template'));
     // create form object
     $form = new YDForm(YDConfig::get('YDCMPAGE_FORMPAGE'));
     $form->addElement('text', 'reference', t('page_reference'), array('size' => 25, 'maxlength' => 35));
     $form->addElement('text', 'title', t('page_title'), array('size' => 70, 'maxlength' => 70));
     $form->addElement('textarea', 'html', t('page_html'));
     $form->addElement('textarea', 'xhtml', t('page_xhtml'));
     $form->addElement('select', 'access', t('page_access'), array(), $access);
     $form->addElement('select', 'state', t('page_state'), array(), array(1 => t('yes'), 0 => t('no'), 2 => t('schedule')));
     $form->addElement('datetimeselect', 'published_date_start', t('page_startdate'));
     $form->addElement('datetimeselect', 'published_date_end', t('page_enddate'));
     $form->addElement('select', 'template_pack', '', array(), $template_pack);
     $form->addElement('select', 'template', t('page_template'), array(), $templates->visitors_templates());
     $form->addElement('select', 'metatags', t('page_metatags'), array(), array(0 => t('no'), 1 => t('yes')));
     $form->addElement('textarea', 'description', t('page_description'), array('cols' => 50, 'rows' => 5));
     $form->addElement('textarea', 'keywords', t('page_keywords'), array('cols' => 50, 'rows' => 5));
     $form->addElement('select', 'searcheable', t('page_search'), array(), array(0 => t('no'), 1 => t('yes')));
     $form->addElement('hidden', 'content_id');
     $form->addElement('hidden', 'parent_id');
     $form->addElement('hidden', 'language_id');
     // parent of new page is 0 by default
     $form->setDefault('content_id', 0);
     $form->setDefault('parent_id', 0);
     $form->setDefault('language_id', $languages->adminDefault());
     // add form rules
     $form->addRule('reference', 'required', t('reference_required'));
     $form->addRule('reference', 'alphanumeric', t('reference_alphanumeric'));
     $form->addRule('reference', 'maxwords', t('reference_maxwords'), 1);
     $form->addRule('reference', 'maxlength', t('reference_maxlength'), 100);
     $form->addRule('title', 'required', t('title_required'));
     $form->addRule('title', 'maxlength', t('title_maxlength'), 255);
     $form->addRule('content_id', 'required', t('content_id_required'));
     $form->addRule('content_id', 'numeric', t('content_id_numeric'));
     $form->addRule('parent_id', 'required', t('parent_id_required'));
     $form->addRule('parent_id', 'numeric', t('parent_id_numeric'));
     $form->addRule('html', 'maxlength', t('html_maxlength'), 50000);
     $form->addRule('xhtml', 'maxlength', t('xhtml_maxlength'), 50000);
     $form->addRule('template_pack', 'in_array', t('template_pack_invalid'), array(0, 1));
     $form->addRule('template', 'in_array', t('template_invalid'), array_keys($templates->visitors_templates()));
     $form->addRule('metatags', 'in_array', t('metatags_invalid'), array(0, 1));
     $form->addRule('description', 'maxlength', t('description_maxlength'), 2000);
     $form->addRule('keywords', 'maxlength', t('keywords_maxlength'), 2000);
     return $form;
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:58,代码来源:YDCMPage.php

示例10: actionDefault

 function actionDefault()
 {
     // Get the list of items
     $items = $this->weblog->getItems();
     // Get the pagesize and current page from the URL
     $page = @$_GET['page'];
     // Create the YDRecordSet object
     $items = new YDRecordSet($items, $page, intval(YDConfig::get('YD_DB_DEFAULTPAGESIZE', 20) / 2));
     // Assign it to the template
     $this->tpl->assign('items', $items);
     // Display the template
     $this->display();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:13,代码来源:items.php

示例11: YDHttpClient

 /**
  *	This is the class constructor for the YDHttpClient class.
  *
  *	@param $host	The host name to connect to.
  *	@param $port	(optional) The port to connect to (default is 80).
  */
 function YDHttpClient($host, $port = 80)
 {
     // Initialize the HTTP client
     $this->HttpClient($host, $port);
     $this->user_agent = 'Mozilla/4.0 (compatible; ' . YD_FW_NAMEVERS . ')';
     $this->contenttype = '';
     if (YDConfig::get('YD_HTTP_USES_GZIP') == 1) {
         $this->useGzip(true);
     } else {
         $this->useGzip(false);
     }
     $this->setDebug(YDConfig::get('YD_DEBUG'));
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:19,代码来源:YDHttpClient.php

示例12: actionDefault

 function actionDefault()
 {
     // Get the list of links
     $links = $this->weblog->getLinks();
     // Get the pagesize and current page from the URL
     $page = @$_GET['page'];
     // Create the YDRecordSet object
     $links = new YDRecordSet($links, $page, YDConfig::get('YD_DB_DEFAULTPAGESIZE', 20));
     // Assign it to the template
     $this->tpl->assign('links', $links);
     // Display the template
     $this->display();
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:13,代码来源:links.php

示例13: toHtml

 /**
  *	This function will return the element as HTML.
  *
  *	@returns	The form element as HTML text.
  */
 function toHtml()
 {
     // Create the list of attributes
     $attribs = array('name' => $this->_form . '_' . $this->_name);
     $attribs = array_merge($this->_attributes, $attribs);
     // check if we are in a Javascript environment
     if (YDConfig::get('YD_FORMELEMENT_TEXTAREA_NL')) {
         $this->_value = preg_replace("/\r*\n/", "\\n", $this->_value);
         $this->_value = preg_replace("/\\//", "\\\\/", $this->_value);
         $this->_value = preg_replace("/'/", " ", $this->_value);
     }
     // Get the HTML
     return '<textarea' . YDForm::_convertToHtmlAttrib($attribs) . '>' . $this->_value . '</textarea>';
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:19,代码来源:YDFormElement_TextArea.php

示例14: install

 function install()
 {
     // Initialize the parent
     $this->YDRequest();
     // Initialize the template
     $this->tpl = new YDTemplate();
     // Get the shortcuts to the directories
     $this->dir_uploads = YDConfig::get('dir_uploads', 'uploads');
     $this->dir_skins = YDConfig::get('dir_skins', 'skins') . '/';
     // Error out if the YDFramework temp directory is not writeable
     $this->_checkWriteableDirectory(YD_DIR_TEMP);
     $this->_checkWriteableDirectory(dirname(__FILE__) . '/include');
     $this->_checkWriteableDirectory(dirname(__FILE__) . '/uploads');
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:14,代码来源:install.php

示例15: initCommentsFeed

 function initCommentsFeed()
 {
     // Get the weblog items
     $comments = $this->weblog->getComments(null, 'CREATED DESC', YDConfig::get('max_syndicated_items', 15));
     // Initialize the feed
     $this->feed = new YDFeedCreator();
     $this->feed->setTitle(YDConfig::get('weblog_title', 'Untitled Weblog') . ' - ' . t('comments'));
     $this->feed->setDescription(YDConfig::get('weblog_description', 'Untitled Weblog Description'));
     $this->feed->setLink(YDUrl::makeLinkAbsolute('index.php'));
     // Add the items
     foreach ($comments as $comment) {
         $body = $comment['comment'] . "\n\n" . t('by') . ' ' . $comment['username'];
         $this->feed->addItem($comment['item_title'], YDTplModLinkItem($comment['item_id'], '#comment'), YDTplModBBCode($body));
     }
 }
开发者ID:BackupTheBerlios,项目名称:ydframework-svn,代码行数:15,代码来源:xml.php


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