using database values in a class

Author Message

rex nedoli

Sunday 04 January 2004 12:53:44 pm

I would like to create a class which would contain, among others, drop down list (selection). Not being much of a developer, I find myself confronted with two problems:

1. the list of values that I want to use this way (countries and states(provinces)) is long. Logic dictates that I store them in database tables and call them up somehow from the class. Is this possible, and how can I do it?

2. Assuming that the above is possible; and with the two list (tables) mentioned above -countries and states - i would also like to make the choice presented in the states selection list to be dependent upon the the choice made in the countries selection - e.g. if the country selected is "Canada", I would like the states list to present only the names of the provinces (states) in "Canada".

On top of being a soso developer, I only have 2.5 days experience with EZ publish - so I do need a some help :)

I, Rex

Kåre Køhler Høvik

Monday 05 January 2004 4:12:55 am

Hi

You should probably create a new datatype to do this. Take a look at this documentation page on how to create a new datatype: http://ez.no/developer/ez_publish_3/documentation/development/extensions/datatypes/new_datatype_

--
Kåre Høvik

Kåre Høvik

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 04:27:04
Script start
Timing: Jan 31 2025 04:27:04
Module start 'layout'
Timing: Jan 31 2025 04:27:04
Module start 'content'
Timing: Jan 31 2025 04:27:04
Module end 'content'
Timing: Jan 31 2025 04:27:04
Script end

Main resources:

Total runtime0.0137 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 588.1406151.2109
Module start 'layout' 0.00510.0030 739.351636.6484
Module start 'content' 0.00820.0042 776.000090.1563
Module end 'content' 0.01230.0013 866.156329.9922
Script end 0.0136  896.1484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002518.2035140.0002
Check MTime0.00118.0008140.0001
Mysql Total
Database connection0.00085.645310.0008
Mysqli_queries0.002820.306230.0009
Looping result0.00000.101110.0000
Template Total0.00107.210.0010
Template load0.00075.411710.0007
Template processing0.00021.717310.0002
Override
Cache load0.00053.758910.0005
General
dbfile0.00032.329380.0000
String conversion0.00000.066340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs