473,466 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Using Classes within another class.

AJ
Ok,

I have a "form" class, which I am going to use to generate HTML forms.

I also have a form_input, which I use to generate the individual HTML
input elements.

What I want to do is some how manage the instances of the form_input
class, within the form class. There should be no problem with this, but I
can't work out how I can store an unspecified number of instances of one
class within another, is it possible to do something like this, and store
them in an array?

$input_array[] = new form_input(some vars...);
$input_array[] = new form_input(some vars...);
$input_array[] = new form_input(some vars...);
$input_array[] = new form_input(some vars...);

then when I want to do stuff with the individual form elements I can do:

$input_array[1]->do_some_function();
$input_array[2]->do_some_function();

Or more likely what I would like to do, is use a foreach loop.

Has anyone done something like this before, and can offer tips?

Many Thanks,
Harry
Jul 17 '05 #1
2 2021
In article <op**************@news.btinternet.com>, AJ wrote:
Ok,

I have a "form" class, which I am going to use to generate HTML forms.

I also have a form_input, which I use to generate the individual HTML
input elements.

What I want to do is some how manage the instances of the form_input
class, within the form class. There should be no problem with this, but I
can't work out how I can store an unspecified number of instances of one
class within another, is it possible to do something like this, and store
them in an array?


array_push ?

--
http://home.mysth.be/~timvw
Jul 17 '05 #2
AJ
On 15 May 2004 10:25:16 GMT, Tim Van Wassenhove <eu**@pi.be> wrote:
In article <op**************@news.btinternet.com>, AJ wrote:
Ok,

I have a "form" class, which I am going to use to generate HTML forms.

I also have a form_input, which I use to generate the individual HTML
input elements.

What I want to do is some how manage the instances of the form_input
class, within the form class. There should be no problem with this, but
I
can't work out how I can store an unspecified number of instances of one
class within another, is it possible to do something like this, and
store
them in an array?


array_push ?


Duh!

Sorry, I'm having one of those days!! It turns out, what I was trying is
possible - but I had cocked up some syntax along the way.

Thanks,
H
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
by: Daniel | last post by:
Hello =) I have an object which contains a method that should execute every x ms. I can use setInterval inside the object construct like this - self.setInterval('ObjectName.methodName()',...
6
by: Alex Fitzpatrick | last post by:
Just by way of introduction, I'm currently the principal developer and maintainer of the a JavaScript editor plug-in for Eclipse. https://sourceforge.net/projects/jseditor/ The plug-in as it...
2
by: Kent Lewandowski | last post by:
hi all, Recently I wrote some stored procedures using java jdbc code (admittedly my first stab) and then tried to implement the same within java packages (for code reuse). I encountered...
2
by: Kolozs, Áron | last post by:
Hi everybody, The C# compiler reports a Compiler Error CS0052 in the following situation: I declared a type marked as "internal": namespace MyNamespace { internal class MyInteralClass
3
by: nevets2001uk | last post by:
Hi. I've just started my second ASP.NET (VB) app and I'm using codebehind this time. I'm not using visual studio but am instead coding it all in notepad (HTML, ASP.NET and CSS) I'm trying to...
2
by: Kevin Frey | last post by:
Is it possible to get c# perform a using statement where the namespace for the using is not specified literally but instead comes from a variable, a token, a predefined value etc. We have...
0
by: peridian | last post by:
Hi, I wanted a web page where I could post code to, and have it appear in coloured formatting based on the context of the code. Most of the techniques I have seen for this involve complex use...
0
by: Clive Dixon | last post by:
When working with lots of associated "supporting" classes alongside classes (by this, I mean things such as associated component editor classes specified by , debugger proxy classes specified by ...
15
by: r0g | last post by:
Hi There, I know you can use eval to dynamically generate the name of a function you may want to call. Can it (or some equivalent method) also be used to do the same thing for the variables of a...
0
by: jb489 | last post by:
Hi all, Hope I am posting this in the right forum. I seem to be having a problem when using serialization and web services. <b>Scenario:</b> I have built a web service which includes a...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.