Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
optional parameters of "component"
#23
no but i am glad you brought this up, since i added 2 arguments already to this function and that might cause issues if I want to add this.

however i am not entirely sure what this thread was attempting to solve, seems most of the discussion is on eval return values ???

components are eval'd, essentially anonymous functions
meaning there is no parameterization possible

I would simply pass func_args to the eval using a static variable for now.
Ideally components would be class methods that can have objects passed into them, since we still require php 5.2 and I dont feel like implementing janky old class constructs, I would just hack this in with an object and let you get it via $self or $this, instead of an actual reflection class or whatever the best solution would actually be in 5.3+

another solution would be to see if we can slip an extract into the code, and simply extract your argument array into the scope of the component.

extract is dangerous but shit we are already inside an eval, soooooo..

solutions welcome
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply


Messages In This Thread
optional parameters of "component" - by bugman - 2011-06-08, 21:29:05
RE: optional parameters of "component" - by shawn_a - 2014-12-18, 07:10:47
optional parameters of "component" - by bugman - 2011-06-08, 21:46:44
optional parameters of "component" - by mvlcek - 2011-06-08, 21:53:29
optional parameters of "component" - by bugman - 2011-06-08, 22:03:32
optional parameters of "component" - by bugman - 2011-06-08, 22:23:43
optional parameters of "component" - by mvlcek - 2011-06-18, 07:23:05
optional parameters of "component" - by mvlcek - 2011-06-18, 21:33:07
optional parameters of "component" - by ccagle8 - 2011-06-20, 09:10:54
optional parameters of "component" - by mvlcek - 2011-06-20, 16:27:53
optional parameters of "component" - by mvlcek - 2011-06-20, 19:36:30
optional parameters of "component" - by mvlcek - 2011-06-20, 20:45:03
optional parameters of "component" - by mvlcek - 2011-06-20, 23:55:27
optional parameters of "component" - by mvlcek - 2011-06-21, 05:28:08



Users browsing this thread: 1 Guest(s)