Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widgets #52

Merged
merged 10 commits into from Sep 4, 2019
Merged

Widgets #52

merged 10 commits into from Sep 4, 2019

Conversation

@terabytesoftw
Copy link
Member

@terabytesoftw terabytesoftw commented Aug 29, 2019

Q A
Is bugfix? ✔️
New feature?
Breaks BC? ✔️
Tests pass? ✔️
@terabytesoftw
Copy link
Member Author

@terabytesoftw terabytesoftw commented Aug 29, 2019

Syntax Proposal:

<?php NavBar::begin()
    ->brandLabel($params['app.name'])
    ->brandUrl($params['app.home.url'])
    ->options([
        'class' => 'navbar navbar-dark bg-dark navbar-expand-lg',
    ])
    ->init();

    echo Nav::widget()
        ->items($menuItems)
        ->options([
            'class' => 'navbar-nav float-right ml-auto'
        ]);

NavBar::end(); ?>

Widget::begin() need init() --> Widget::begin()->init()/Widget::end();
Widget::widget() need return in run(): string.

samdark
samdark approved these changes Sep 1, 2019
Copy link
Member

@samdark samdark left a comment

Looks good so far 👍

src/View/DynamicContentAwareTrait.php Outdated Show resolved Hide resolved
src/Widget/Block.php Outdated Show resolved Hide resolved
src/Widget/Widget.php Outdated Show resolved Hide resolved
src/Widget/Widget.php Show resolved Hide resolved
src/Widget/Widget.php Outdated Show resolved Hide resolved
src/Widget/Widget.php Outdated Show resolved Hide resolved
@@ -70,10 +77,12 @@ protected function setUp(): void
$this->aliases = $this->container->get(Aliases::class);
$this->assetManager = $this->container->get(AssetManager::class);
$this->eventDispatcher = $this->container->get(EventDispatcherInterface::class);
$this->listenerProvider = $this->container->get(ListenerProviderInterface::class);
Copy link
Member

@samdark samdark Sep 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems listenerProvider isn't declared as class property.

Copy link
Member Author

@terabytesoftw terabytesoftw Sep 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@samdark samdark Sep 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean there's no private $listenerProvider in the class itself.

Copy link
Member Author

@terabytesoftw terabytesoftw Sep 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but I need it to test the events.

tests/bootstrap.php Outdated Show resolved Hide resolved
@terabytesoftw
Copy link
Member Author

@terabytesoftw terabytesoftw commented Sep 4, 2019

The widgets that are missing are those that have to do with activerecord and cache they are:

  • ActiveField.php.
  • ActiveForm.php.
  • ActiveFormClientScript.php.
  • FragmentCache.php.
  • InputWidget.php.
  • LinkPager.php.
  • LinkSorter.php.

@samdark
Copy link
Member

@samdark samdark commented Sep 4, 2019

  1. Let's do active forms separately. These require great deal of rethinking because Yii 3 isn't limited to Active Record.
  2. FragmentCache could be done right now (or separately if you prefer). We have everything for it.
  3. Pager and sorter should be done later when https://github.com/yiisoft/data is ready and will be part of https://github.com/yiisoft/yii-dataview.

@samdark samdark changed the title Draft widgets no merge. Widgets Sep 4, 2019
@samdark samdark marked this pull request as ready for review Sep 4, 2019
@samdark samdark merged commit 9e00c63 into yiisoft:master Sep 4, 2019
1 of 4 checks passed
@terabytesoftw terabytesoftw deleted the Terawidget branch Sep 5, 2019
vjik added a commit that referenced this issue Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants