R
R
Roma Antonyuk2017-05-15 17:55:56
Yii
Roma Antonyuk, 2017-05-15 17:55:56

Which practice is better "write the code by hand" or "use the widget"?

What are the advantages and disadvantages of using widgets rather than writing HTML code by hand? Widgets of interest: NavBar, Nav, Menu

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2017-05-15
@webinar

The main plus is code reuse and more readable code. The answer to the question "should I use built-in widgets" depends entirely on your application. Sometimes they fit, sometimes they don't. But there is no doubt that you should try to write more of your widgets, because there is still convenient work with dependencies, assets, etc.
And of course, if the same Nav does not suit you a little, you can make your own widget and inherit from it. Redefine everything that is necessary in it and bring it to the form you need for the project. This is a sandbox. You were given a mountain of bees, which ones to use or use your own - your choice.

I
IceJOKER, 2017-05-15
@IceJOKER

  1. Don't reinvent the wheel.
  2. Saving time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question