Hans Solo
Hans Solo

Reputation: 55

How to add bootstrap to a PHP code?

I've been trying to style a PHP website using bootstrap. Most of the website including things like textbox and select are coded in PHP. How do I add bootstrap to it?

 array("type"=>"select", "name"=>"agentId", "value"=>getAgentASMOption($partyCode), "title"=>"Select Party");

Upvotes: 0

Views: 2805

Answers (4)

5eeker
5eeker

Reputation: 1027

Bootstrap framework is just a library with classes and id's for styling HTML elements.

You can add the required class name in your php array in below manner.

array("type"=>"select", "class"=>"yourclass" , "name"=>"agentId", "value"=>getAgentASMOption($partyCode), "title"=>"Select Party");

Upvotes: 1

Paras Pitroda
Paras Pitroda

Reputation: 208

Bootstrap is nothing more than a CSS and JS. You just need to add class/ID in HTML elements. I am assuming that in your PHP code have capabilities to add these things using array keys and values.

 array("type"=>"select", "name"=>"agentId", "value"=>getAgentASMOption($partyCode), "id"=>"fieldID", "class"=>"cssClass", "title"=>"Select Party");

Now you need to define these class in your css files. Make sure you define different values for responsive purpose in media query.

Upvotes: 0

Pramod Patil
Pramod Patil

Reputation: 2763

Add class attribute in your array and css to that class.

array("type"=>"select", "name"=>"agentId", "value"=>getAgentASMOption($partyCode), "title"=>"Select Party", "class"=>"selectClass");

css

.selectClass{
width: 100%;
}

Upvotes: 0

Rahul
Rahul

Reputation: 2474

Add class attribute as :

array("type"=>"select", "name"=>"agentId", "value"=>getAgentASMOption($partyCode), "title"=>"Select Party","class"=>"myclass");

and then in css

.myclass{
 // your code
}

Upvotes: 0

Related Questions