Integrate Yii With Plain Html And Jquery?

Hello, I’m new in Yii.

I already build a plain HTML with bootstrap wizard, jquery validation and other things that i build purely in Html and Jquery (of course there’s no AJAX).

Now i want to integrate Yii with my custom build HTML. And i mean to integrate is, as simple as CRUD operation.

How to achieve this?

Thank you for your help.

Now generally speaking you should create a webapp with Yii and copy your html over to the Yii’s layout and views.

it is all located in protected/views. Read more about views and layouts here: http://www.yiiframework.com/doc/guide/1.1/en/basics.view

For creating your first application read here: http://www.yiiframework.com/doc/guide/1.1/en/quickstart.first-app

Try your way through and ask if you hit into any errors

Thank you for your answer bettor,

maybe I’m not specific enough for now. but i have some question in my mind now, I see that Yii will be generate this code from CActiveForm:


 <input id="UserDetail_Birth" name="UserDetail[Birth]" class="m-wrap span12" type="text" placeholder="Date Birth..." readonly>

And my question is:

do i need using the Yii "id" and "name" convention as Yii generate?

my goal is simple, i don’t want to use the Yii build engine template and replace that with my own template, and then integrate that with the model and controller in Yii.

It depends on how you are planning to handle the CActiveForm in your controller later on. If you would like to mass assign your attributes to a model then I suggest you stick with Yii default name. But to answer your question no you don’t have to stick with Yii way of naming ‘id’ and ‘name’ attributes. May be if you provide a use case scenario it will be much easier to answer questions

Hi reptildarat,

Generally speaking you would be better throw away the current development style of your own (at least for the moment), if you ever want to maximize the benefit of using Yii.

I don’t think it’s easy to cherry pick the goodies of Yii into your, say, homemade framework. It’s because Yii is not a library but a framework.

Instead, try to comprehend the way Yii works and accustom yourself to it. Then you will find a way to utilize your knowledge about HTML, bootstrap and jQuery … in fact it will surely help you make a good app with Yii.

Thank You all,

Your suggestion is very helpful… :rolleyes: