Giter Club home page Giter Club logo

Comments (4)

kaidesu avatar kaidesu commented on June 7, 2024

It's not different, really. Only thing different is the syntax when calling a widget vs. plugin. Widgets append widget_ at the beginning while plugins do not append anything. They're very similar in the way they're executed but the use case is different. For instance, widgets should always return a view partial, but plugins should only return a data set (e.g. a collection of blog posts).

I may end up merging the two into one package. I kinda threw this together to get a feel for the workflow and use-case.

from plugins.

illuminate3 avatar illuminate3 commented on June 7, 2024

Thanks!

Hmmm, just throwing out some thoughts.
What you just described sounds to me that this package is a "widget". So, I'd say to combine them then.

packages > modules > plugins > widgets
However, everybody probably sees this different 😄

from plugins.

illuminate3 avatar illuminate3 commented on June 7, 2024

Looks like I got stuck in the L 5.x to 5.1 changes...
(I'm still on L5.x until I can update my apps / modules)

Hmmm,
So, I shouldn't be using plugins to send data to a blade view?
And use widgets to do that instead?

from plugins.

illuminate3 avatar illuminate3 commented on June 7, 2024

gonna add my vespoken menu code as a reference:

my plugin (older type it seems ... 😦 )

        Menu::handler('top')->hydrate(function()
            {
            $pages = Content::where('print_status_id', '=', 2)->orderBy('order')->get();
//dd($pages);
            return $pages;
            },
            function($children, $item)
            {
                if($item->depth < 1) {
                    $children->add($item->slug, $item->translate(Config::get('app.locale'))->title, Menu::items($item->as));
                }
            });

        return view("plugins.navigation_menu");

my main template call:

<ul class="nav navbar-nav">
{!!
    Plugin::MenuNavigation()
!!}
</ul>

my actual view:

<! -- Plugin -->

{!!
    Menu::handler('top')
        ->getItemsAtDepth(0);
!!}

from plugins.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.