Tortuga Software - web development (programming) with PHP / MySQL / Apache
Useful PHP-classes, scripts, manuals, articles, tutorials
E-mail: info@usefulclasses.com ICQ: 749345 GTalk: varenich@gmail.com
Let Visitors Enjoy Your Site!
   

  Save To del.icio.us Digg this Post Save To Slashdot Bookmarks Save To FURL Save To Newsvine Save to Yahoo! My Web 2.0 Save To Reddit Save To Simpy Save To Shadows

phpAddDict - Add Power of Dictionaries into Your PHP Scripts


The Library of PHP classes to make it easier to work with a large number of lists (dictionaries/references) on the web pages.

The Library is designed for PHP Programmers and Webmasters who independently develop complex websites.


SCRIPT MOVED TO THE NEW SITE phpAddDict.com


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 references 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 myref.

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 references into the database.

How can the list be displayed with myref 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 myref library: methods for adding, removing, changing and obtaining the lists).

Additional advantages of the myref library

  1. Multilingual references 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 references. 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 myref 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 for $15 from eMetrix secure payment system.

Live Demo

Be in touch with Script Updates

Subscribe to:

Tortuga Software News and Updates | RSS
Name:
Email:
Format:

 

Useful PHP scripts   Home

   Log In


Our PHP-it! Blog

Interesting PHP Articles

Interesting PHP Resources

 



 
Do You Have a Question? We'll Be Glad to Answer You
Your name: Message text:  
E-mail:
 
 
 
 
Contacts
E-mail: info@usefulclasses.com
ICQ: 749345
GTalk: varenich@gmail.com
  Creative Commons License

Text of this work is licensed under a Creative Commons Attribution-NoDerivs 2.5 License.
To use this work, please specify a hyperlink to this site: http://www.usefulclasses.com

Import Export Trade Leads Portal. Submit for Free.