LennardF1989
Member
As I got to know XenForo pretty well over the last few months and really loving how it works internally, I decided to setup a small CMS project roughly based on XenForo's methodology with its autoloading based on class-names and being able to dynamically resolve classes (which is a pretty darn simple yet smart and very effective system for add-ons).
With that in place, I started to experiment a little and raised myself a question. When you define an action in a XenForo-controller, its in the following format:
If I wanted to retrieve an Id passed to the controller I'd have to do additional functions calls to do so.
I was therefor wondering why you guys decided to go with that approach, rather than let the function-signature decide. For example:
In this case, the following URL would get automatically parsed and passed to actionFoobar: index.php?test/foobar&id=0&ssomething=Test.
I now implemented that last approach myself and it seems pretty useful.
With that in place, I started to experiment a little and raised myself a question. When you define an action in a XenForo-controller, its in the following format:
Code:
public function actionFoobar() {}
I was therefor wondering why you guys decided to go with that approach, rather than let the function-signature decide. For example:
Code:
public function actionFoobar($id, $something = "Foobar") {}
In this case, the following URL would get automatically parsed and passed to actionFoobar: index.php?test/foobar&id=0&ssomething=Test.
I now implemented that last approach myself and it seems pretty useful.