Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Mad_Griffith

  • Rank

Recent Profile Visitors

6,169 profile views
  1. And also in this case: module.exports = { get myProp() { mySubProp: { return { ExternalModuleObject´╗┐, } = require("./myexternalmodule") } }, init: function() { myprop = new ... } }
  2. I have the following data: module.exports = { get myProp() { return { ExternalModuleObject, } = require("./myexternalmodule") } init: function() { myprop = new ... } } How to correctly create an ExternalModuleObject's instance inside init()?
  3. And I am also wondering why something like this is incorrect: RewriteCond %{HTTP_HOST} my.website.com RewriteRule ^(?:https\:\/\/)?\w*\.(.+) www.$1/my [P] The pattern is syntactically correct.
  4. "Example 2" on this page. In my case, the server and domain name is always the same.
  5. I have this rewrite rule RewriteCond %{HTTP_HOST} ^DomainA.com RewriteRule ^(.*) http://DomainB.com/PathToPageHere [P] but it just acts as a normal redirect (the address changes).
  6. Hi, I am trying to have my.website.tld redirect to www.website.tld/my. The constraints: 1) "my" is not a folder, but a Wordpress category with posts. 2) I would like to keep the url as "my.website.tld" How can I accomplish that? Thank you.
  7. Thank you so much. I found this resource and I may need a mix of a Factory / FrontController kind of thing, although I am not too keen on abstracting the dispatcher. But the philosophy behind what I am trying to do quite matches the FrontController pattern.
  8. Because I want the Child class to be as clean as possible and somehow abstract that method's firing.
  9. I need to fire the appropriate Child's method firing: $moduleInstance->$method;
  10. I am doing it because I would like to have an entry point Class to control all the routing. I would still need to have modules such as Site inherit methods and properties from a superclass, though.
  11. This is a more faithful code. I need to instantiate Module only once because it can be extended for an indefinite number of times. I hope you can shed some light as I am currently stuck. <?php class Site extends Module { public function indexAction() { echo 'init\'ed!'; } } class Module { public $name; public function getName() { return $this->name; } public function setName($name) { $this->name = $name; } public function getMethod() { return $this->method; } public function setMethod($method) {
  12. Hi, I am stuck in a conundrum. I have the following code: class Dad { public function setup() { // sets object and local vars } public function init() { $sonInstance = new $sonName(); $sonInstance->$methodName(); } public function __construct($sonName = null, $methodName = null) { $this->setup($moduleName, $methodName); } } class Son extends Dad { public function doSomething() { } } All this complication is needed because I need to have Dad() flexible enough to call Son() dynamically and be also able to inject the Son's class and method directly (pleas
  13. I just noticed I am in a conundrum. in firstMethod() I am also setting the value of a few SecondClass' variables that I want to be accessible in ThirdClass, but which of course is not set in ThirdClass if I either add the check in the SecondClass' constructor or override the constructor in ThirdClas. How do I overcome that? Thank you.
  14. uhm, I get your points. What do you think of this solution? firstMethod() is actually just a init function containing stuff that SecondClass won't share with any other class. public function __construct() { if (get_class($this) !== 'SecondClass') return; $this->firstMethod(); }
  15. ThirdClass is something I would like to keep clean, if possible. I will put a check on the class in SecondClass' constructor. Anyway, thank you, I didn't know constructors are inherited.
  • Create New...