Loops and Classes


Posted on 16th Feb 2014 07:03 pm by admin

I am making a template system and everything seems to be going well up until I have to loop in a variable where things starts to go weird. I need ideas on how to solve this.

It is not picking up variables where it changes within the loop.

Did you know?Explore Trending and Topic pages for more stories like this.
Ie...

Code: for ($i=0;$i<3; $i++) {
$body->loop_blocks('test_area', array(
"TEST" => $i,
"TEST2" => $test2)
);
}
It picks up TEST2 variable as it remains constant, but TEST variable remains at 0.

Code: function loop_blocks($blockname, $array = array()) {

$this->$_blockdata[$blockname . "."] = $array;

foreach ($this->$_blockdata[$blockname . "."] as $tags => $data) {
$this->_looparray[$blockname . "."] = ereg_replace("{" . $tags . "}", $data, $this->_looparray[$blockname . "."]);
}

return true;
}
$this->_looparray[$blockname . "."] is where a particular block of HTML Code needs to be repeated for a loop.

Any thoughts?
No comments posted yet

Your Answer:

Login to answer
331 Like 13 Dislike
Previous forums Next forums
Other forums

MII Trends - add data onto chart object
Hello,

Can anyone please provide some thoughts on my current requirement:
its pretty

Rand() help needed
Hi all,

Can someone explain and give me a quick example of how I would go about this?

Help pulling in 'id' with "read more" link
I'm trying to create snippets of my articles in the cms I'm creating, and then have them redirect to

$variable $variables type question
I need to be able to designate an array element dynamically, so I thought to use a variable variable

Phase Error I can't seem to find :(`
Hey guys, I can seem to find my phase error on this. I am getting this error

[error]
Pars

Loosing changed contents when used FM REUSE_ALV_GRID_DISPLAY
Hi,

I have used FM REUSE_ALV_GRID_DISPLAY in my program as below.

CALL FUNCT

Change Sort Order to Display Newest File First
Hi Guys,

I have a page that sorts the contents (PDFs) of a directory and displays them on the

Drop Down and text box issue
Is it possible to set a drop down list and text boxes to a certain width?

here is my code

Somebody hacked into my site and changed coding >>> URGENT HELP NEEDED <<<
I am not that much into programming , but somebody is hacking to my site and injecting some kind of

Variable uses and placement
I'm new to PL/SQL and am trying to learn about variable valid uses/placement (any pointers to any do

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash