本文整理汇总了PHP中AbstractPage::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractPage::__construct方法的具体用法?PHP AbstractPage::__construct怎么用?PHP AbstractPage::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AbstractPage
的用法示例。
在下文中一共展示了AbstractPage::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
$columns = array();
$columns[] = new picon\PropertyColumn('Sample Value', 'value');
$provider = new SampleDataProvider();
$this->add(new \picon\DefaultDataTable('table', $provider, $columns));
}
示例2: __construct
public function __construct()
{
parent::__construct();
$self = $this;
$this->add(new Link('login', function () use($self) {
$_SESSION['auth'] = true;
$self->setPage(HomePage::getIdentifier());
}));
}
示例3:
function __construct()
{
global $USER;
parent::__construct();
$this->hasAlliance = $USER['ally_id'] != 0;
$this->hasApply = $this->isApply();
if ($this->hasAlliance && !$this->hasApply) {
$this->setAllianceData($USER['ally_id']);
}
}
示例4: __construct
public function __construct()
{
parent::__construct();
$this->domain = new ExampleDomain();
$this->setModel(new CompoundPropertyModel($this, 'domain'));
$feedback = new FeedbackPanel('feedback');
$this->add($feedback);
$form = new Form('form');
$this->add($form);
$self = $this;
$form->add(new Button('button', function () use($self) {
$self->info('First button pressed, valid form');
}, function () use($self) {
$self->info('First button pressed, invalid form');
}));
$form->add(new Button('button2', function () use($self) {
$self->info('Second button pressed, valid form');
}, function () use($self) {
$self->info('Second button pressed, invalid form');
}));
$submitedInfo = new MarkupContainer('submitedInfo');
$this->add($submitedInfo);
$choices = array('default', 'option', 'other option', 'something else');
$form->add(new TextField('textBox'));
$form->add(new TextArea('textArea'));
$form->add(new DropDown('select', $choices));
$group = new RadioGroup('rgroup');
$form->add($group);
$group->add(new Radio('gradio1', new BasicModel('option1')));
$group->add(new Radio('gradio2', new BasicModel('option2')));
$form->add(new CheckBox('icheck'));
$checkGroup = new CheckBoxGroup('cgroup');
$form->add($checkGroup);
$checkGroup->add(new Check('check1', new BasicModel('option1')));
$checkGroup->add(new Check('check2', new BasicModel('option2')));
$form->add(new RadioChoice('rchoice', $choices));
$form->add(new CheckChoice('cchoice', $choices));
$form->add(new ListMultiple('mchoice', $choices));
$submitedInfo->add(new Label('textBox'));
$submitedInfo->add(new Label('textArea'));
$submitedInfo->add(new Label('select'));
$submitedInfo->add(new Label('rgroup'));
$submitedInfo->add(new Label('icheck'));
$submitedInfo->add(new ListView('cgroup', function (&$item) {
$item->add(new picon\Label('value', $item->getModel()));
}));
$submitedInfo->add(new Label('rchoice'));
$submitedInfo->add(new ListView('cchoice', function (&$item) {
$item->add(new picon\Label('value', $item->getModel()));
}));
$submitedInfo->add(new ListView('mchoice', function (&$item) {
$item->add(new picon\Label('value', $item->getModel()));
}));
}
示例5: __construct
public function __construct()
{
parent::__construct();
$collection = new picon\TabCollection();
$collection->addTab('One', function ($id) {
return new TabOnePanel($id);
});
$collection->addTab('Two', function ($id) {
return new TabTwoPanel($id);
});
$this->add(new picon\TabPanel('tabs', $collection));
}
示例6: __construct
public function __construct($key, $title, $parent = null)
{
parent::__construct($key, $title, $parent);
add_action('wp_ajax_' . $this->get_ajax_action(), function () {
$this->_ajax_action();
});
if (is_admin() && isset($_REQUEST['page']) && $_REQUEST['page'] == $this->_key && isset($_POST) && !empty($_POST)) {
add_action('init', function () {
$this->_post_action();
});
}
}
示例7: __construct
public function __construct(AbstractModel $model, array $config)
{
parent::__construct($model, $config);
if (array_key_exists('description', $this->config)) {
Head::getInstance()->addOg('description', $this->config['description']);
}
if (!array_key_exists('subtitle', $this->config) || $this->config['subtitle']) {
$title = Config::getInstance()->title . ' - ' . $this->config['name'];
Head::getInstance()->addOg('title', $title);
Head::getInstance()->setTitle($title);
}
}
示例8: __construct
public function __construct()
{
parent::__construct();
$this->add(new picon\Label('text', new picon\PropertyModel($this, 'text')));
$self = $this;
$this->add(new \picon\Link('alterLink', function () use($self) {
$self->text = 'Update in callback text';
}));
$this->add(new \picon\Link('pageLink', function () use($self) {
$self->setPage(HomePage::getIdentifier());
}));
}
示例9: __construct
public function __construct()
{
parent::__construct();
$label = new picon\Label('text', new picon\PropertyModel($this, 'text'));
$label->setOutputMarkupId(true);
$this->add($label);
$self = $this;
$this->add(new \picon\AjaxLink('alterLink', function (picon\AjaxRequestTarget $target) use($self, $label) {
$self->text = 'Update in callback text';
$target->add($label);
}));
}
示例10: __construct
public function __construct()
{
$id = Util::getRequest('id');
if ($id == null || intval($id) != $id) {
Util::redirect('?missing_id');
}
// Hash auslesen
$results = RoItem::getObjects(array('i.id' => $id), array('to' => 1), "i.online ASC, i.item_id ASC, i.price_one ASC");
if ($results == null || is_array($results) == false || count($results) == 0) {
Util::redirect('?hash_not_found');
}
$this->item = current($results);
$this->item->loadHits();
parent::__construct();
}
示例11: __construct
public function __construct()
{
parent::__construct();
$fruit = array('apples', 'pears', 'bananas', 'oranges');
$this->add(new ListView('fruit', function ($entry) {
$entry->add(new Label('name', new BasicModel($entry->getModelObject())));
}, new ArrayModel($fruit)));
$repeatingView = new \picon\RepeatingView('repeater');
$this->add($repeatingView);
foreach ($fruit as $item) {
$element = new Label('text', new BasicModel($item));
$container = new picon\MarkupContainer($repeatingView->getNextChildId());
$container->add($element);
$repeatingView->add($container);
}
}
示例12: switch
function __construct()
{
parent::__construct();
$action = HTTP::_GP('action', '');
switch ($action) {
case 'success':
$this->IPN();
break;
case 'cancel':
$this->Cancel();
break;
case 'ipn':
$this->IPN();
break;
default:
$this->CallOrder();
break;
}
}
示例13: __construct
public function __construct()
{
parent::__construct();
$layoutExamples = array();
$layoutExamples[] = new Example('Markup Inheretence', MarkupInheritancePage::getIdentifier());
$layoutExamples[] = new Example('Panels', PanelPage::getIdentifier());
$layoutExamples[] = new Example('Borders', BorderPage::getIdentifier());
$generalExamples = array();
$generalExamples[] = new Example('Labels', LabelPage::getIdentifier());
$generalExamples[] = new Example('Links', LinkPage::getIdentifier());
$generalExamples[] = new Example('Lists', ListPage::getIdentifier());
$generalExamples[] = new Example('Tabs', TabPanelPage::getIdentifier());
$formExamples = array();
$formExamples[] = new Example('Form Fields', FormPage::getIdentifier());
$formExamples[] = new Example('Validation', ValidationPage::getIdentifier());
$formExamples[] = new Example('Special Fields', SpecialFields::getIdentifier());
$tableExamples = array();
$tableExamples[] = new Example('Data Table', DataTablePage::getIdentifier());
$ajaxExamples = array();
$ajaxExamples[] = new Example('Ajax Link', AjaxLinkPage::getIdentifier());
$ajaxExamples[] = new Example('Ajax Button', AjaxButtonPage::getIdentifier());
$authoExamples[] = new Example('Authorised Access Page', AuthorisedPage::getIdentifier());
$examples = array();
$examples[] = new ExampleType('General', $generalExamples);
$examples[] = new ExampleType('Layout', $layoutExamples);
$examples[] = new ExampleType('Form Components', $formExamples);
$examples[] = new ExampleType('Data Tables', $tableExamples);
$examples[] = new ExampleType('Ajax', $ajaxExamples);
$examples[] = new ExampleType('Security', $authoExamples);
$self = $this;
$this->add(new ListView('examples', function (picon\ListItem $item) use($self) {
$type = $item->getModelObject();
$item->add(new picon\Label('title', new picon\BasicModel($type->name)));
$item->add(new ListView('list', function (picon\ListItem $item) use($self) {
$link = new picon\Link('link', function () use($item, $self) {
$self->setPage($item->getModelObject()->page);
});
$item->add($link);
$link->add(new picon\Label('exampleName', new picon\BasicModel($item->getModelObject()->name)));
}, new picon\ArrayModel($type->examples)));
}, new ArrayModel($examples)));
}
示例14: __construct
public function __construct()
{
parent::__construct();
$feedback = new \picon\FeedbackPanel('feedback');
$feedback->setOutputMarkupId(true);
$this->add($feedback);
$label = new picon\Label('text', new picon\PropertyModel($this, 'text'));
$label->setOutputMarkupId(true);
$this->add($label);
$form = new picon\Form('form');
$this->add($form);
$form->add(new picon\RequiredTextField('text', new picon\PropertyModel($this, 'text')));
$self = $this;
$form->add(new \picon\AjaxButton('button', function (picon\AjaxRequestTarget $target) use($label, $feedback) {
$target->add($label);
$target->add($feedback);
}, function (picon\AjaxRequestTarget $target) use($feedback) {
$target->add($feedback);
}));
}
示例15: __construct
public function __construct()
{
parent::__construct();
$feedback = new picon\FeedbackPanel('feedback');
$this->add($feedback);
$form = new \picon\Form('form');
$form->add(new \picon\DateField('date', new \picon\PropertyModel($this, 'date')));
$feedback->setOutputMarkupId(true);
$this->add($form);
$model = new \picon\FileModel();
$form->add(new \picon\FileUploadField('file', $model));
$self = $this;
$form->add(new picon\Button('button', function () use($model, $self) {
$self->success(sprintf("The file was uploaded successfully. Name: %s, size: %d", $model->getName(), $model->getSize()));
$self->success(sprintf('Date was: %s', $self->date));
}));
$form->add(new picon\AjaxButton('ajaxbutton', function (picon\AjaxRequestTarget $target) use($feedback, $model, $self) {
$self->success(sprintf("The file was uploaded successfully. Name: %s, size: %d", $model->getName(), $model->getSize()));
$self->success(sprintf('Date was: %s', $self->date));
$target->add($feedback);
}));
}