本文整理汇总了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;
}
示例2:
function __construct($group, $owner = null, $action = null)
{
parent::__construct($action);
$this->group = $group;
$this->owner = $owner;
$this->action = $action;
}
示例3:
function __construct($portfolio, $owner = null, $action = null)
{
parent::__construct($action);
$this->portfolio = $portfolio;
$this->owner = $owner;
$this->action = $action;
}
示例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;
}
示例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;
}
}
示例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);
}
示例7:
function __construct()
{
$title = _t('FlickrWidget.PHOTOS', 'Photos');
$cmsTitle = _t('FlickrWidget.FLICKRPHOTOS', 'Flickr Photos');
$description = _t('FlickrWidget.FLICKRPHOTOSDESCRIPTION', 'Display your Flickr photos.');
parent::__construct();
}
示例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];
}
}
}
示例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;
}
示例10:
function __construct($connection, Profile $owner, Action $out = null)
{
parent::__construct($out);
common_debug("ConnectedAppsList constructor");
$this->connection = $connection;
$this->owner = $owner;
}
示例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';
}
}
}
示例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);
}
示例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']);
}
}
示例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++;
}
}
}
示例15:
function __construct($profile, $owner = null, $action = null)
{
parent::__construct($action);
$this->profile = $profile;
$this->owner = $owner;
$this->action = $action;
}