Home About phpAddDict Screenshots Demo Buy/Order FAQ Documentation Support Service


How to automate lists / dictionaries / references generation

Every PHP-programmer faces the task of outputting a large number of lists (dictionaries/references) on the HTML-page. The typical lists are gender, country, job etc.

Here is an example of the HTML-page containing lists (dictionaries/references):

List elements are marked with red.

List can be either “select” element or “checkbox” and “radio”:

The core is that generally there are many such lists on the page . Every web-site consists of a number of such pages . It takes a lot of time and efforts to work with the large amount of lists and references.

Every list is actually stored in a separate table of a database and is extracted from it by its own specific request. If there are many of lists, the page code becomes too complicated to cope with.

Moreover, if the system has been developed for a long time, it suddenly becomes clear that every reference should work in several languages at the same time, for example, in English, Russian and German. And program code becomes more and more inexplicable and complicated with every such upgrade of the page.

So,

One cool tool is wanted for the comfortable work with any dictionaries/reference.

The tool should work with all system dictionaries at once and provide them with a single API.

Would you like to create a new list? This problem does not exist with the tool now: any task is solved in a minute as it does not require any additional coding .

What are the main tasks of the tool?

Undoubtedly, they are

  1. Output of the dictionaries on the HTML-page.
  2. Input of the reference values into the database.
The tool above does exist. This library for work with lists is called phpAddDict .

How does it work and where it can be used?

Library solves two main tasks:

  1. It gets lists from database for further output on the HTML-page.
  2. It provides administrative script for inputting the dictionaries into the database.

How can the list be displayed with phpAddDict library?

For example, if you need to show “gender” and “job function” lists on your HTML-page then execute only one command in your script:

$refs = $refController->getReferences(array( ‘gender', 'job_ function' ));

The reaction of the library on this command will be:

var_dump($refs); 

array(2) { 
  ["job_function"]=> 
  array(3) { 
    ["design"]=> string(17) "Making web design" 
    ["prog"]=> string(11) "Programming" 
    ["srs"]=> string(31) "Preparing Software Requirements" 
  } 
  ["gender"]=> array(2) { 
    ["f"]=> string(6) "Female" 
    ["m"]=> string(4) "Male" 
  } 
}

Then we need to output all received values onto the HTML-page. Only one command is required for this in Smarty ( http://smarty.php.net ):

$tpl->assign($refs);

In the HTML-templates lists are created in a similar simple way:

{html_options name=gender options=$gender} 
{html_options name=job_function options=$job_ function }

The ordinary way of displaying the list is the following:

<select name=”gender”>
<?php
  foreach ($refs[‘gender'] as $key=>$val) { 
    echo “<option value=\”$key\”>$val</option>\n”; 
  } 
?>
</select>

And one more similar block for the job_function reference. All is quite simple…

How can the lists be added to the database with this library?

The administrative script available with the library can be used for inputting data to the database.

Script and library installation is carefully described in the installation manual.

There is no point in describing the order of operations in the administrative script, so I recommend you to see the demonstrational version of the script and to read the user's guide for it.

It is possible to put lists into the database not only through the available administrative script, so you can use your own one with API provided by phpAddDict library: methods for adding, removing, changing and obtaining the lists).

Additional advantages of the phpAddDict library

  1. Multilingual dictionaries are supported.
  2. Fully documented program code.
  3. The library is designed so that to minimize the number of requests to the database. This prevents the server from overloading and increases your script operation speed.
  4. System architecture is developed so that you can easily update or change it.
  5. There are UML-models of classes: deployment diagram, static and organizational diagrams, so if necessary you can easily learn how the internal mechanism of the library works.

The system can be used not only for storing the dictionaries. For example, the error messages of your software under development can be stored in it.

At the same time the important problem of translating the error messages into other languages is solved.

Return the error code and get the translation to the different languages. You can manage the error messages in the administrative system and database, and not in the configuration file!

The phpAddDict package consists of:

  1. Library of PHP-classes to use in your scripts.
  2. Script of the administrative system for the manual input of reference values.
  3. Installation manual.
  4. User's guide.

Summary

Undoubtedly, this library makes script-related tasks much easier for PHP-programmer and enables him to considerably shorten the time for software development and to concentrate on other much more important modules.

Order Script

Order script for $29 from eMetrix secure payment system.

Live Demo

Administrational panel

Use of the library from your scripts

 

Home About phpAddDict Screenshots Demo Buy/Order FAQ Documentation Support Service Contact Us Press Center

Best price at breitling replica watches in Watch-Clone internet watches shop.. Computer Inventory Software - PC Inventory Software & PC Audit. Бытовая техника фото Интернет магазин отзывы техника.