Mal Blackshaw Mon Feb 20 07:44:08 -0500 2012

Subject: newbie to activerecord

I've decided to update my develoment skills and come across this
I've got slim framework running and linked activerecords, I understand the CRUD but don't quite follow how to create the HTML forms? so I can do some basic Create | Edit | Delete is there a section on this anywhere
or an example to create | edit | delete and link PHP to the HTML form?

Cheers

Mal


Afeique Sheikh Mon Feb 20 10:40:41 -0500 2012

Hi Mal,

Forgive me if I misunderstood your question. I'm not sure if you're asking whether ActiveRecord itself can create the HTML for CRUD (it can't) or whether you're just looking for examples linking HTML forms to PHP (see below).

There are quite a few tutorials for the latter, just search for "php html forms tutorial" in google.

Tizag has a pretty good starter tutorial on the topic, and it's also the first result from that search:
http://www.tizag.com/phpT/examples/formex.php

Max Schwanekamp Mon Feb 20 16:42:47 -0500 2012

Mal, if you're new to ORMs in PHP, you might look instead at using one of the more popular frameworks with an ORM component built in. Many PHP frameworks have form builder components to go with it. A few suggestions are "Fuel PHP,":fuelphp.com Laravel, CakePHP 2 (not 1.x!), or Kohana. IMHO PHPAR is best suited when you need a lightweight standalone ORM.

If you really want to use PHP Active Record, you could use the CodeIgniter framework with the PHPAR spark and one of the various form builder sparks available there too.

(1-2/2)