本文整理汇总了PHP中Layout::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Layout::__construct方法的具体用法?PHP Layout::__construct怎么用?PHP Layout::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layout
的用法示例。
在下文中一共展示了Layout::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param Widget $fieldWidget Field widget
* @param array $config Configuration options
* @param string $config['align'] Alignment mode, either 'left', 'right', 'top' or 'inline'
* (default: 'left')
* @param string $config['help'] Explanatory text shown as a '?' icon.
*/
public function __construct($fieldWidget, array $config = array())
{
// Allow passing positional parameters inside the config array
if (is_array($fieldWidget) && isset($fieldWidget['fieldWidget'])) {
$config = $fieldWidget;
$fieldWidget = $config['fieldWidget'];
}
$hasInputWidget = $fieldWidget instanceof InputWidget;
// Config initialization
$config = array_merge(array('align' => 'left'), $config);
// Parent constructor
parent::__construct($config);
// Properties
$this->fieldWidget = $fieldWidget;
$this->field = new Tag('div');
$this->body = new Tag($hasInputWidget ? 'label' : 'div');
if (isset($config['help'])) {
$this->help = new ButtonWidget(array('classes' => array('oo-ui-fieldLayout-help'), 'framed' => false, 'icon' => 'info', 'title' => $config['help']));
} else {
$this->help = '';
}
// Mixins
$this->mixin(new LabelElement($this, $config));
// Initialization
$this->addClasses(array('oo-ui-fieldLayout'))->appendContent($this->help, $this->body);
$this->body->addClasses(array('oo-ui-fieldLayout-body'));
$this->field->addClasses(array('oo-ui-fieldLayout-field'))->toggleClasses(array('oo-ui-fieldLayout-disable'), $this->fieldWidget->isDisabled())->appendContent($this->fieldWidget);
$this->setAlignment($config['align']);
}
示例2: __construct
public function __construct($title,$description,$view)
{
parent::__construct($title,$description,$view);
// shared amoung all pages on the site
$this->add_style("reset");
$this->add_style("default");
}
示例3: __construct
/**
* @param array $config Configuration options
* @param Widget[]|Layout[] $config['items'] Widgets or other layouts to add to the layout.
*/
public function __construct(array $config = [])
{
// Parent constructor
parent::__construct($config);
// Traits
$this->initializeGroupElement(array_merge($config, ['group' => $this]));
// Initialization
$this->addClasses(['oo-ui-horizontalLayout']);
if (isset($config['items'])) {
$this->addItems($config['items']);
}
}
示例4: __construct
/**
* @param array $config Configuration options
* @param Widget[]|Layout[] $config['items'] Widgets or other layouts to add to the layout.
*/
public function __construct(array $config = array())
{
// Parent constructor
parent::__construct($config);
// Mixins
$this->mixin(new GroupElement($this, array_merge($config, array('group' => $this))));
// Initialization
$this->addClasses(array('oo-ui-horizontalLayout'));
if (isset($config['items'])) {
$this->addItems($config['items']);
}
}
示例5: __construct
/**
* @param array $config Configuration options
* @param string $config['method'] HTML form `method` attribute
* @param string $config['action'] HTML form `action` attribute
* @param string $config['enctype'] HTML form `enctype` attribute
* @param FieldsetLayout[] $config['items'] Items to add
*/
public function __construct(array $config = [])
{
// Parent constructor
parent::__construct($config);
// Traits
$this->initializeGroupElement(array_merge($config, ['group' => $this]));
// Initialization
$attributeWhitelist = ['method', 'action', 'enctype'];
$this->addClasses(['oo-ui-formLayout'])->setAttributes(array_intersect_key($config, array_flip($attributeWhitelist)));
if (isset($config['items'])) {
$this->addItems($config['items']);
}
}
示例6: __construct
/**
* @param array $config Configuration options
* @param string $config['method'] HTML form `method` attribute
* @param string $config['action'] HTML form `action` attribute
* @param string $config['enctype'] HTML form `enctype` attribute
* @param FieldsetLayout[] $config['items'] Items to add
*/
public function __construct(array $config = array())
{
// Parent constructor
parent::__construct($config);
// Mixins
$this->mixin(new GroupElement($this, array_merge($config, array('group' => $this))));
// Initialization
$attributeWhitelist = array('method', 'action', 'enctype');
$this->addClasses(array('oo-ui-formLayout'))->setAttributes(array_intersect_key($config, array_flip($attributeWhitelist)));
if (isset($config['items'])) {
$this->addItems($config['items']);
}
}
示例7: __construct
/**
* @param array $config Configuration options
* @param FieldLayout[] $config['items'] Items to add
*/
public function __construct(array $config = array())
{
// Parent constructor
parent::__construct($config);
// Mixins
$this->mixin(new IconElement($this, $config));
$this->mixin(new LabelElement($this, $config));
$this->mixin(new GroupElement($this, $config));
// Initialization
$this->addClasses(array('oo-ui-fieldsetLayout'))->prependContent($this->icon, $this->label, $this->group);
if (isset($config['items'])) {
$this->addItems($config['items']);
}
}
示例8: __construct
/**
* @param array $config Configuration options
* @param FieldLayout[] $config['items'] Items to add
*/
public function __construct(array $config = [])
{
// Parent constructor
parent::__construct($config);
// Traits
$this->initializeIconElement($config);
$this->initializeLabelElement(array_merge($config, ['labelElement' => new Tag('legend')]));
$this->initializeGroupElement($config);
// Initialization
$this->group->addClasses(['oo-ui-fieldsetLayout-group']);
$this->addClasses(['oo-ui-fieldsetLayout'])->prependContent($this->label, $this->icon, $this->group);
if (isset($config['items'])) {
$this->addItems($config['items']);
}
}
示例9: __construct
/**
* @param Widget $fieldWidget Field widget
* @param array $config Configuration options
* @param string $config['align'] Alignment mode, either 'left', 'right', 'top' or 'inline'
* (default: 'left')
* @param array $config['errors'] Error messages about the widget, as strings or HtmlSnippet
* instances.
* @param array $config['notices'] Notices about the widget, as strings or HtmlSnippet instances.
* @param string|HtmlSnippet $config['help'] Explanatory text shown as a '?' icon.
* @throws Exception An exception is thrown if no widget is specified
*/
public function __construct($fieldWidget, array $config = array())
{
// Allow passing positional parameters inside the config array
if (is_array($fieldWidget) && isset($fieldWidget['fieldWidget'])) {
$config = $fieldWidget;
$fieldWidget = $config['fieldWidget'];
}
// Make sure we have required constructor arguments
if ($fieldWidget === null) {
throw new Exception('Widget not found');
}
$hasInputWidget = $fieldWidget::$supportsSimpleLabel;
// Config initialization
$config = array_merge(array('align' => 'left'), $config);
// Parent constructor
parent::__construct($config);
// Properties
$this->fieldWidget = $fieldWidget;
$this->errors = isset($config['errors']) ? $config['errors'] : array();
$this->notices = isset($config['notices']) ? $config['notices'] : array();
$this->field = new Tag('div');
$this->messages = new Tag('ul');
$this->body = new Tag($hasInputWidget ? 'label' : 'div');
if (isset($config['help'])) {
$this->help = new ButtonWidget(array('classes' => array('oo-ui-fieldLayout-help'), 'framed' => false, 'icon' => 'info', 'title' => $config['help']));
} else {
$this->help = '';
}
// Mixins
$this->mixin(new LabelElement($this, $config));
$this->mixin(new TitledElement($this, array_merge($config, array('titled' => $this->label))));
// Initialization
$this->addClasses(array('oo-ui-fieldLayout'))->appendContent($this->help, $this->body);
if (count($this->errors) || count($this->notices)) {
$this->appendContent($this->messages);
}
$this->body->addClasses(array('oo-ui-fieldLayout-body'));
$this->messages->addClasses(array('oo-ui-fieldLayout-messages'));
$this->field->addClasses(array('oo-ui-fieldLayout-field'))->toggleClasses(array('oo-ui-fieldLayout-disable'), $this->fieldWidget->isDisabled())->appendContent($this->fieldWidget);
foreach ($this->notices as $text) {
$this->messages->appendContent($this->makeMessage('notice', $text));
}
foreach ($this->errors as $text) {
$this->messages->appendContent($this->makeMessage('error', $text));
}
$this->setAlignment($config['align']);
}
示例10: __construct
/**
* @param array $config Configuration options
* @param boolean $config['scrollable'] Allow vertical scrolling (default: false)
* @param boolean $config['padded'] Pad the content from the edges (default: false)
* @param boolean $config['expanded'] Expand size to fill the entire parent element
* (default: true)
* @param boolean $config['framed'] Wrap in a frame to visually separate from outside content
* (default: false)
*/
public function __construct(array $config = array())
{
// Config initialization
$config = array_merge(array('scrollable' => false, 'padded' => false, 'expanded' => true, 'framed' => false), $config);
// Parent constructor
parent::__construct($config);
// Initialization
$this->addClasses(array('oo-ui-panelLayout'));
if ($config['scrollable']) {
$this->addClasses(array('oo-ui-panelLayout-scrollable'));
}
if ($config['padded']) {
$this->addClasses(array('oo-ui-panelLayout-padded'));
}
if ($config['expanded']) {
$this->addClasses(array('oo-ui-panelLayout-expanded'));
}
if ($config['framed']) {
$this->addClasses(array('oo-ui-panelLayout-framed'));
}
}
示例11: __construct
public function __construct()
{
parent::__construct();
$this->xtype('tabpanel');
return $this;
}
示例12: __construct
public function __construct($title, $description, $view)
{
parent::__construct($title, $description, $view);
}
示例13: __construct
public function __construct()
{
$this->currentYear = date('Y', strtotime(Model::now()));
parent::__construct();
}
示例14:
/**
* DivBasedTabbedLayout - Constructor
*/
function __construct($root)
{
// Parent constructor
parent::__construct($root);
$this->imgroot = $root . '/images/';
}
示例15: __construct
public function __construct($view)
{
$this->addNavigationLink(new Link('<img src="img/logo.png" />', UrlFactory::indexLangue(), 'logo'));
$this->addBreadcrumbsLink(new Link('', UrlFactory::indexLangue(), 'home'));
parent::__construct($view);
}