Feeds

Get your PHP on the right Trax

Framework flattery

New hybrid storage solutions

A controller script catalog_controller.php gets created in the controllers directory. View templates _form.phtml, edit.phtml, index.phtml, add.phtml, and show.phtml get created in the views directory.

Modify the _form.phtml view template. Add the following line as the first line in the _form.phtml form:

<p><label for="catalog_id">Id:</label><br/>
<?= text_field("catalog", "id") ?></p>

The default URL for a URL action is http://localhost/controller/action. Custom URLs may also be defined in the config/routes.php file. For example, the add controller action of catalog controller may be invoked by specifying a custom router in the config/routes.php file. With the custom router the url http://localhost/catalog invokes the add action of the catalog controller.

$router->connect( "catalog",array(":controller" => "catalog",":action" => "add") );

Next, we shall use the scaffolding for the catalogs table to add a new catalog entry. Invoke the index controller action with the URL http://localhost/catalog/index. The catalogs listing gets displayed. The Show, Edit, and Delete links are for displaying, editing and deleting a catalog entry respectively. To create a new listing click on the New hyperlink.

In the New catalog view template, create a new catalog entry and click on Create.

A new catalog entry gets added to the database table catalogs and gets listed in the "Listing catalogs".

There you have it - that's how you create a PHP MVC CRUD application without using too much PHP code thanks to the PHP On Trax Framework. You can download code for the project here

Security for virtualized datacentres

More from The Register

next story
Not appy with your Chromebook? Well now it can run Android apps
Google offers beta of tricky OS-inside-OS tech
New 'Cosmos' browser surfs the net by TXT alone
No data plan? No WiFi? No worries ... except sluggish download speed
Greater dev access to iOS 8 will put us AT RISK from HACKERS
Knocking holes in Apple's walled garden could backfire, says securo-chap
NHS grows a NoSQL backbone and rips out its Oracle Spine
Open source? In the government? Ha ha! What, wait ...?
Google extends app refund window to two hours
You now have 120 minutes to finish that game instead of 15
Intel: Hey, enterprises, drop everything and DO HADOOP
Big Data analytics projected to run on more servers than any other app
prev story

Whitepapers

Providing a secure and efficient Helpdesk
A single remote control platform for user support is be key to providing an efficient helpdesk. Retain full control over the way in which screen and keystroke data is transmitted.
Top 5 reasons to deploy VMware with Tegile
Data demand and the rise of virtualization is challenging IT teams to deliver storage performance, scalability and capacity that can keep up, while maximizing efficiency.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.
Secure remote control for conventional and virtual desktops
Balancing user privacy and privileged access, in accordance with compliance frameworks and legislation. Evaluating any potential remote control choice.