Integrate HTML web into Yii2

Hello,

Im new with Yii2 but I have more than 20 years experience in the field, so please I just want some help about how to do the next task, just point me to the right direction:

I have some HTML5 pure websites, all designed using Bootstrap 4, now my client wants to add some functionality like backend admin side, option for store, search products, add items etc in a local DB and I think Yii2 could be the best solution.

So, how can integrate the actual designs/theme/templates into Yii2? Thanks in advance!

Hi @mlacunza, welcome to the forum!!

Do you have some experience in development of a web application built on a DB? Or is your experience limited to the construction of a static web site?

What you should do in the next step may depend on the answer. But IMO you would be better start developing a pet project using Yii just for your fun and learning.

Hi,

I can create whatever type of website, like I said Im new with Yii only, thanks!

For start create frontend:
First try to put in view/layouts/main.php your main theme code
Than in sitecontroller put some static pages actions and render include in views/site directory content of those pages to render.
If you finish with those 2 steps, than add db config and use it to index items on frontend.

1 Like

Why do you have to ask that in the first place, if you have 20y experience in the field?
Should be needless in regards of your knowledge or how you’d approached your web application projects from the past.
If you consider Yii2 or something else for your project, you first do a quick check on it’s features.
If you would have on Yii2, you’d read in the guide about views/layouts, theming support, using templates and know about how you can integrate your stuff with it.

Hi @rafalrudowskisnlb

Thanks for your answer, Do you think this link is the beginning of how I should face the problem?

https://www.yiiframework.com/doc/guide/2.0/en/output-theming

“Theme” is the way how Yii handled this?

@Androphin

Whats your problem with my question? apart from the fact that you dislike that apparently I have more experience than you.
Have you ever been new to something? And when has it been like this, have you not wished that those who know best guide you on the right path?

It contradicts whatever you claim to be and therefore the necessity of the question.
To your rhetorical question: I often learn something new. But at first, I learn about it with what’s already publicly available to avoid questions that are easily answered by just putting some little effort in it. Next step is asking questions.
That’s the process with nearly every technical topic out there.
Not doing so is kinda revealing the inexperienced or the lazy.
But some expect that others should spend their time doing their work/research for them.

really? :rofl:

I think that if you have nothing more than personal attacks that do not help at all to solve my question, you should waste your time elsewhere.

I found this video series:

Yii Manual in Video

videos #39 and #40 give me a very good answer and a nice starting point.

Thanks!

Nice you’ve got it
instead of theme I was thinking about layouts
https://www.yiiframework.com/doc/guide/2.0/en/structure-views
Topics from link:
creating layouts, creating view, rendering in controller, accessing data in view

1 Like

@rafalrudowskisnlb
Thanks! yes yesterday I reach that part of the manual and Im coding a full time :sunglasses:

The docs for this project are really nice!