Luqman
Luqman

Reputation: 249

Yii2 : Using a complete UI/Design not from Yii

my friend and I are working on a website. He will taking care the frontend UI, customizations, and all other end users related stuff. The layouts/themes are bootstrap based, with additions to the Metronic theme.

My job is on the server side, which we have decided to implement the MVC framework, which led to using Yii2. so now the view part is my friend's job, I will take care of the Model and Controller. I am familiar enough with its default views, but I am confused as of how do I completely use the ones that my friend is working on. All forms, inputs, main page are all custom made.

I read about Assets, and how to implement themes, etc but most examples that I saw is related to themes that have some Yii2-based(or is it Bootstrap) kind of feeling(not sure if I'm right about that).

My real question is, since the layout of the website will have everything in one folder(html/css/js/bootstrap stuff/etc), where do I put those in the Yii2 app, how do I define and point the controller to the right view? Is there any modifications needed to be made to the work that has been done by my friend?

I hope my question is understandable. Thank you.

Upvotes: 1

Views: 587

Answers (1)

ScaisEdge
ScaisEdge

Reputation: 133380

For the view.. you can simply render the view in the same way your render the default view..

anyway you can define the view to show when you assign in render part of your action .. eg:

    return $this->render('index', [
        'searchModel' => $searchModel,
        'dataProvider' => $dataProvider,
    ]);

'index' is the name of the view in your related view/controller_name_directory/
You can assign the corresponding name you need..

For the css and js related to theme if this based on bootstrap simply change the content in bower/dist otherway you can use asset for define the css and js component you need..

In this way you overide the default asset without problem problem..

Upvotes: 1

Related Questions