This is a little howto on how to use the autoschema generator:

Assumptions

  1. you have pear, DB_DataObject_FormBuilder, and all dependancies instaled.
  2. You know how to setup the DSN. [have link point to DSN setup]
  3. You have a database setup.

Getting started

  1. config/db_dataobject.ini
[DB_DataObject]
database = mysql://user:password@localhost/dbName
schema_location = E:/HTTPRoot/Calendar/config/
class_location = E:/HTTPRoot/Calendar
extends = DB_DataObject
extends_location = DB/DataObject.php
require_prefix  = DataObjects/
class_prefix = DataObjects_

where

database = mysql://user:password@localhost/dbName

user = username

password = password

localhost = the host/ip of your database

dbName = the name of the database

- run -> 
php.exe regenerate_dabaobject_info.php

or any other method of running

php.exe DB/DataObject/createTables.php db_databoject.ini

I would recommend have db_dataobject.ini placed somewhere outside of the reach of your webserver deamon.

  1. Profit!

Using Foreign Keys in dropdown / select menus

pseudo schema

tbl_Categories
categories_id;
title;


tbl_Books
books_id;
title;
categories_id;

make a <dbName>.links.ini file, that accompanies your "dbName.ini" that got generated from above.

inside dbName.link.ini file add:

[tbl_Books]
categories_id : tbl_Categories:categories_id;

inside your generated tbl_Books.php file add the line to your class

var $fb_linkDisplayFields = array('title', 'categories_id');

inside your generated tbl_Categories.php file add the line to your class

var $fb_linkDisplayFields = array('title');

inside your db_dataobject.ini add the line

linkDisplayLevel = 2

You have to set linkDisplayLevel greater than 1. Read the docs for further information

FileUpload

 
pear/formbuilder/userdocs.txt · Last modified: 2008/09/16 11:49 (external edit)
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki