janet287 wrote:Given the following code, I need to add into the logic a call to another function. I am not quite sure how to do it:
Is that any reason why you do not have a Course class and a CourseAttForBlock class and then directly instantiate objects of those classes?
janet287 wrote:How would I add that in? Basically this code is creating a course and as the course is being created I need it to add an instance of courseattforblock, which is what that other function does.
To tell you that we would need more information on what the function does, what it requires as its argument and what does it return, if does have a return value. Calling the function is simple:
courseattforblock_add_instance($x);
The problem is knowing when to call it, what to pass as $x, and whether its return value should be used.
anoopmail wrote:try store the entire code bunch to a variable then,
I do not think that is a solution in the first place, and even it is was, eval() is usually the wrong approach.