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


PHP Widget::__construct方法代码示例

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


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

示例1:

 function __construct($target, HTMLOutputter $action)
 {
     parent::__construct($action);
     $this->target = $target;
     $this->profile = $this->target;
     $this->action = $action;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:7,代码来源:profilelistitem.php

示例2:

 function __construct($group, $owner = null, $action = null)
 {
     parent::__construct($action);
     $this->group = $group;
     $this->owner = $owner;
     $this->action = $action;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:7,代码来源:grouplist.php

示例3:

 function __construct($portfolio, $owner = null, $action = null)
 {
     parent::__construct($action);
     $this->portfolio = $portfolio;
     $this->owner = $owner;
     $this->action = $action;
 }
开发者ID:himmelex,项目名称:NTW,代码行数:7,代码来源:portfoliolist.php

示例4: __construct

 /**
  * Initialize the object
  * @param array
  */
 public function __construct($arrAttributes = null)
 {
     parent::__construct($arrAttributes);
     $this->arrAttributes['maxlength'] = 2;
     $this->strCaptchaKey = 'c' . md5(uniqid(mt_rand(), true));
     $this->mandatory = true;
 }
开发者ID:rikaix,项目名称:core,代码行数:11,代码来源:FormCaptcha.php

示例5: __construct

 /**
  * Disable the for attribute if the "multiple" option is set
  * @param array
  */
 public function __construct($arrAttributes = null)
 {
     parent::__construct($arrAttributes);
     if ($this->multiple) {
         $this->blnForAttribute = false;
     }
 }
开发者ID:rburch,项目名称:core,代码行数:11,代码来源:TextField.php

示例6:

 /**
  * constructor
  *
  * Also initializes the owner attribute.
  *
  * @param Notice $notice The notice we'll display
  */
 function __construct($peopletag, $current, $out = null)
 {
     parent::__construct($out);
     $this->peopletag = $peopletag;
     $this->current = $current;
     $this->profile = Profile::getKV('id', $this->peopletag->tagger);
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:14,代码来源:peopletaglistitem.php

示例7:

 function __construct()
 {
     $title = _t('FlickrWidget.PHOTOS', 'Photos');
     $cmsTitle = _t('FlickrWidget.FLICKRPHOTOS', 'Flickr Photos');
     $description = _t('FlickrWidget.FLICKRPHOTOSDESCRIPTION', 'Display your Flickr photos.');
     parent::__construct();
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:7,代码来源:FlickrWidget.php

示例8: array

 /**
  * constructor
  *
  * Also initializes the profile attribute.
  *
  * @param Notice $notice The notice we'll display
  */
 function __construct(Notice $notice, Action $out = null, array $prefs = array())
 {
     parent::__construct($out);
     if (!empty($notice->repeat_of)) {
         $original = Notice::getKV('id', $notice->repeat_of);
         if (!$original instanceof Notice) {
             // could have been deleted
             $this->notice = $notice;
         } else {
             $this->notice = $original;
             $this->repeat = $notice;
         }
     } else {
         $this->notice = $notice;
     }
     $this->profile = $this->notice->getProfile();
     // integer preferences
     foreach (array('maxchars') as $key) {
         if (array_key_exists($key, $prefs)) {
             $this->{$key} = (int) $prefs[$key];
         }
     }
     // boolean preferences
     foreach (array('addressees', 'attachments', 'options') as $key) {
         if (array_key_exists($key, $prefs)) {
             $this->{$key} = (bool) $prefs[$key];
         }
     }
     // string preferences
     foreach (array('id_prefix', 'item_tag') as $key) {
         if (array_key_exists($key, $prefs)) {
             $this->{$key} = $prefs[$key];
         }
     }
 }
开发者ID:phpsource,项目名称:gnu-social,代码行数:42,代码来源:noticelistitem.php

示例9: __construct

 public function __construct(XMLOutputter $out = null, Profile $profile = null, $editable = false)
 {
     parent::__construct($out);
     $this->profile = $profile;
     $this->ext = new ExtendedProfile($this->profile);
     $this->editable = $editable;
 }
开发者ID:microcosmx,项目名称:experiments,代码行数:7,代码来源:extendedprofilewidget.php

示例10:

 function __construct($connection, Profile $owner, Action $out = null)
 {
     parent::__construct($out);
     common_debug("ConnectedAppsList constructor");
     $this->connection = $connection;
     $this->owner = $owner;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:7,代码来源:connectedappslist.php

示例11: __construct

 /**
  * Initialize the object and in front-end, get the public an private key from page layout
  * @param array
  */
 public function __construct($arrAttributes = null)
 {
     parent::__construct($arrAttributes);
     $this->mandatory = true;
     $this->arrAttributes['required'] = true;
     if (TL_MODE == 'BE') {
         return;
     }
     global $objPage;
     $layout = $this->getPageLayout($objPage);
     $this->reCaptcha = new Lib\Captcha();
     $this->reCaptcha->setSsl($this->Environment->ssl);
     //Use keys only if both are set, else default keys
     if (strlen($layout->recPublicKey) && strlen($layout->recPrivateKey)) {
         $this->reCaptcha->setPublicKey($layout->recPublicKey);
         $this->reCaptcha->setPrivateKey($layout->recPrivateKey);
     } else {
         $this->reCaptcha->setPublicKey('6LfECAUAAAAAABFYnrzQvfUgwRzsxvziubNBoSw0');
         $this->reCaptcha->setPrivateKey('6LfECAUAAAAAACvo8uibMG4JnRcr5mXIA6YdDt_v');
     }
     // Dirty workaround to add language to api url, because due to a bug Google
     // does not take language from RecaptchaOptions above, see also:
     // https://groups.google.com/forum/?fromgroups#!topic/recaptcha/o-YdYJlnRVM
     $this->reCaptcha->setPublicKey($this->reCaptcha->getPublicKey() . '&hl=' . $GLOBALS['TL_LANGUAGE']);
     $this->theme = strlen($layout->recTheme) ? $layout->recTheme : 'red';
     //Custom theme file
     if ($layout->recTheme == 'custom') {
         if ($layout->recCustomTemplate != null) {
             $this->strTemplate = $layout->recCustomTemplate;
         } else {
             //Fallback to clean template
             $this->theme = 'clean';
         }
     }
 }
开发者ID:mrflory,项目名称:contao-recaptcha,代码行数:39,代码来源:ReCaptcha.php

示例12: __construct

 public function __construct($name, array $data)
 {
     if (!array_key_exists('params', $data)) {
         $data['params'] = array('perpage' => 10, 'startwith' => 'last');
     }
     parent::__construct($name, $data);
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:7,代码来源:widget.comment.php

示例13: __construct

 /**
  * @param array $config Configuration options
  * @param string $config['name'] HTML input name (default: '')
  * @param string $config['value'] Input value (default: '')
  * @param string $config['dir'] The directionality of the input (ltr/rtl)
  */
 public function __construct(array $config = [])
 {
     // Parent constructor
     parent::__construct($config);
     // Properties
     $this->input = $this->getInputElement($config);
     // Traits
     $this->initializeFlaggedElement(array_merge($config, ['flagged' => $this]));
     $this->initializeTabIndexedElement(array_merge($config, ['tabIndexed' => $this->input]));
     $this->initializeTitledElement(array_merge($config, ['titled' => $this->input]));
     $this->initializeAccessKeyedElement(array_merge($config, ['accessKeyed' => $this->input]));
     // Initialization
     if (isset($config['name'])) {
         $this->input->setAttributes(['name' => $config['name']]);
     }
     if ($this->isDisabled()) {
         $this->input->setAttributes(['disabled' => 'disabled']);
     }
     $this->addClasses(['oo-ui-inputWidget'])->appendContent($this->input);
     $this->input->addClasses(['oo-ui-inputWidget-input']);
     $this->setValue(isset($config['value']) ? $config['value'] : null);
     if (isset($config['dir'])) {
         $this->setDir($config['dir']);
     }
 }
开发者ID:oojs,项目名称:oojs-ui,代码行数:31,代码来源:InputWidget.php

示例14: __construct

 /**
  * constructor
  *
  * @param array|null $attributes
  */
 public function __construct($attributes = null)
 {
     parent::__construct($attributes);
     $this->names[0] = 'email';
     $this->values[0] = '';
     $this->names[1] = 'url';
     $this->values[1] = '';
     $this->names[2] = static::getRandomString();
     $this->values[2] = static::getRandomString();
     $fields = \Database::getInstance()->prepare("SELECT name FROM tl_form_field WHERE pid = ?")->execute($this->pid);
     if ($fields) {
         $fields = $fields->fetchEach('name');
         // check if the field name already exists in the form
         $count = 2;
         while (in_array($this->names[0], $fields)) {
             $this->names[0] = 'email-' . $count;
             $count++;
         }
         // check if the field name already exists in the form
         $count = 2;
         while (in_array($this->names[1], $fields)) {
             $this->names[1] = 'url-' . $count;
             $count++;
         }
     }
 }
开发者ID:madeyourday,项目名称:contao-rocksolid-antispam,代码行数:31,代码来源:AntispamField.php

示例15:

 function __construct($profile, $owner = null, $action = null)
 {
     parent::__construct($action);
     $this->profile = $profile;
     $this->owner = $owner;
     $this->action = $action;
 }
开发者ID:Br3nda,项目名称:laconica,代码行数:7,代码来源:profilelist.php


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