PHP-WAX View Helpers

There are plenty of repetitive tasks that you need to do inside an HTML view. The beauty of helpers is that you only have to use them if they're helpful. Over the course of the next few versions the number and functionality of the helpers will increase greatly. At the moment one of the major benefits of using helpers is to simplify form creation.

 <?= content_tag($name, $content, $options)?>

Content tag creates an html tag and surrounds the value of the content.

 <?= error_messages_for("model_name")?>

This prints out any error messages after a form submission.

 <?= image_tag('image') ?>

Displays an image from the public/images directory.

 <?= stylesheet_link_tag('stylesheet')?>

Links to a stylesheet located in the public/stylesheets directory.

 <?= javascript_include_tag('script')?>

Includes a javascript file from the public/javascripts directory.

More from this section

RECENT PERSONAL WORK

A.G. Cox Plumbing
alltradeart Case Study
Kwik Travel Case Study
Allotment Case Study

RECENT ARTICLES

Rails and Apache

In what appears to be a very useful find ' read more

Useful bit of Javascript

Never thought about using javascript for this before but I had a requ... read more

Quick jquery Gallery

I had a look at some of the gallery plugins available for jquery and ... read more

Massive CPU usage when updating Fedora using YUM/RPMQ

We noticed that YUM and RPMQ processes were using a massive amount CP... read more

CREDITS

powered by php-wax the php framework