jst4fun Posted March 19, 2007 Share Posted March 19, 2007 Hi, I am currently working on a site. This site is developed using qcodo framework. I got a page in which 5 rows with 5 text box in each rows are displayed. In qcodo each textbox is an object of a class called QTextBox. I wanted to add additional 5 rows on user reaching the last textbox of the previous 5 rows. This is an on going process until the user clicks on to the save button. I tried to make the objects into an array using the following code <?php public $txtQtn = array(); $this->txtQtn[0] = new QTextBox($this); $this->txtQtn[0]->Width = "50"; $this->txtQtn[0]->ActionParameter = "1"; ?> When i tried to exicute this script I got firefox download manager asking me whether I wanted to download this script or not. So this means i am wrong somewhere. So my question is how can I create my objects dynamically? Hope someone would help me. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/43401-solved-creating-dynamic-objects/ Share on other sites More sharing options...
btherl Posted March 20, 2007 Share Posted March 20, 2007 Is that your full code? It doesn't appear to be valid php syntax. The code looks like it should be inside a class definition, but the class definition is missing. Quote Link to comment https://forums.phpfreaks.com/topic/43401-solved-creating-dynamic-objects/#findComment-210894 Share on other sites More sharing options...
Daniel0 Posted March 20, 2007 Share Posted March 20, 2007 You cannot have public or $this outside of a class. We need your entire code. Quote Link to comment https://forums.phpfreaks.com/topic/43401-solved-creating-dynamic-objects/#findComment-210959 Share on other sites More sharing options...
boo_lolly Posted March 20, 2007 Share Posted March 20, 2007 yeah, it looks like you're trying to create an object of a class inside a class... but you're obviously outside a class. Quote Link to comment https://forums.phpfreaks.com/topic/43401-solved-creating-dynamic-objects/#findComment-211203 Share on other sites More sharing options...
jst4fun Posted March 20, 2007 Author Share Posted March 20, 2007 I solved that error. It was a stupidity from my part. This file also got a template file. I forgot to change the variable name in that template file. I am sorry for this post . Thanks to all those who tried to help me out. Quote Link to comment https://forums.phpfreaks.com/topic/43401-solved-creating-dynamic-objects/#findComment-211338 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.