CodeCanyon Html Helper Class 161718

CodeCanyon Html Helper Class 161718

CodeCanyon Html Helper Class 161718
PHP Script \ Miscellaneous
Input \ Helper \ Tags \ Select \ Html \ Generate \ Clean \ Class \ Code \ Elements \ Form

PHP Script - Html Helper Class 161718 by Sitebase @ CodeCanyon

PHP Script \ Miscellaneous

Last Update: 18 February 11; Software Version: PHP 5.x; Files Included: HTML, CSS, PHP.

One of the things that can make your scripts really hard to read and take up much space are inline HTML tags. This helper class makes it possible to write inline html tags in a really simple an clean way.

Take for example the following code. It is used to show a select box and the selected variable is to choose a select item.

&lt;?php $selected = 'green' ?&gt;<br /><select name="colors" id="colors" /><br /> <option value="" &lt;?php if($selected=='red') echo 'selected="selected"'; ?&gt;>Red<br /> <option value="" &lt;?php if($selected=='green') echo 'selected="selected"'; ?&gt;>Green<br /> <option value="" &lt;?php if($selected=='yellow') echo 'selected="selected"'; ?&gt;>Yellow<br />
With the Html Helper class you will use the following code to get the same result.

echo HtmlHelperselect(id, name, values array, selected item);

so this will give us the following code.

echo HtmlHelperselect('colors', 'colors', array('red' => 'Red', 'green' => 'Green', 'yellow' => 'Yellow'), 'green');

As you can see is the code with the Html Helper is much easier to understand, read and modify.

Of course does the Html Helper class not only support select but almost every Html element.

- label

- textfield

- textarea

- checkbox

- radiobutton

- select

- ul

- ol

- img

- a

- img

- style

- script

- swf (embed youtube, vimeo and other flash content)

Beside the above elements you can also use the openTag/closeTag or tag method to create any html element you want. All these methods and the tag methods have an extra attribute parameter. This way you can add any extra attributes that you want. For example to create the folloing div.

<div class="test" style="color: #F00">Hello world</div>
you would use the following Html Helper code

echo HtmlHelpertag('div', 'Hello world', array('class' => 'test', 'style' => 'color: #F00'));
As last example I show you how easy it is to show a youtube video. This will also work with custom SWF files or other videos like from Vimeo. Normally you would place the following code on your website.

<object height="390" width="480"><br /><param name="movie" value=";hl=en_US&amp;rel=0" />
<param name="allowFullScreen" value="" /><br /><param name="allowscriptaccess" value="" /><br /><embed allowfullscreen="true" src=";hl=en_US&amp;rel=0" allowscriptaccess="always" type="application/x-shockwave-flash" height="390" width="480"></embed><br /></object>
But with the Html helper class you could use the following code.

echo HtmlHelperswf(';hl=en_US&amp;rel=0', 480, 390, null, array('allowscriptaccess' => 'always', 'allowfullscreen' => 'true'));
1.1 14/03/2011

- SWF method now outputs same code as SWFObject for better cross browser support

Google Maps for Mobile Site PRO; Twitter Wall for Mobile Site PRO; Mobile Site PRO; News Widget for WordPress; Testimonials for WordPress; API Client; Google Analytics for Joomla.

Keywords: attributes, class, clean code, elements, form, generate, html helper, input, oop, php, select, tags.

Tags: Class, Helper, Input, Select, Elements, Attributes

Premium CodeCanyon Html Helper Class 161718 WordPress Themes, Website Templates, Mobile Themes, Flash Templates & Scripts from creative professional designers. Full details of CodeCanyon Html Helper Class 161718 for digital design and education. CodeCanyon Html Helper Class 161718 desigen style information or anything related.


Add Comments:
Enter Code: *