Solutions to Repetitive Code
See how many times the common function repeats. Is there a more concise and maintainable way to achieve this functionality without repeating or writing a bunch of code?
I appreciate any examples or suggestions
Solution:Jump to solution
I have create a Helper class and createt a function like this
```php
class Helpers
{...
4 Replies
Solution
I have create a Helper class and createt a function like this
And using it like this
BINGO!! IT WORKS!!!!
Now I have to write this for my solution:
Instead of a helper class, I have created another function inside the same class.
Thanks a lot my friend @Tieme 😊
Inside the same class is also possible what you did.
It is in my helper because i use it in all relations to a order, so multiple classes.
I agree. I may need that in near future. I will go with the helper class approach then.
@Tieme This is the final solution I came up with