|
Posted by Erwin Moller on 09/27/07 08:23
Smiley wrote:
> "RageARC" <ragearc@gmail.com> wrote in message
> news:1190803170.330649.206250@g4g2000hsf.googlegroups.com...
>> That's what I thought as well. Why not simply include that file? I
>> mean, it would surely give you less headaches...
>>
>
> What I'm trying to do is figure out a way to work in simplified coding
> statements for an end user who uses a system so that they can have a greater
> deal of control without needing to know PHP code. The simplified code is
> interpreted, but I also wanted the ability for users to put in their own PHP
> code so I'm using eval to those parts of it.
Hi Smiley,
I am aware of the fact it must be irritating to receive responses like
this, but we advise this because we want to help.
If your goal is to simplify coding statements, I would start using OOP
instead.
So instead of building an array with pieces of code on each line, build
an object that has methods that do the same.
You'll end up with code like:
$smileyObj->resetCalc();
$smileyObj->add(12);
$smileyObj->add(34.5);
$smileyObj->add(1.123);
echo $smileyObj->calculateAverage();
One (very good) reason OOP exists/is popular is the fact you can hide
complexity behind a simple method.
Allthough I don't want to say my example (average calculation) has
anything to do with complexity. ;-)
Regards,
Erwin Moller
[Back to original message]
|