Jump to content

chrizz

Members
  • Content Count

    108
  • Joined

  • Last visited

Community Reputation

53 Excellent

About chrizz

  • Rank
    Sr. Member

Profile Information

  • Gender
    Male
  • Location
    Berlin, Germany

Recent Profile Visitors

3,697 profile views
  1. @marcus, yep. that works and I'd available for beers πŸ™‚
  2. haha. obviously.... the wrong question... yes πŸ€¦β€β™‚οΈ Thanks a lot for pointing me into the right direction
  3. @bernhard, thats what I did as well - but then I ran into trouble because I needed to access the same class from a different module (autoloaded as well). And then it became tricky because I don't know any way to control the order of autoloading πŸ˜‰
  4. I have a module (autoload: true) which uses a custom class. If it would be only relevant for templates, _init.php would be the way to go but due to autoload functionality I need the class also to be availabel in the backend - this is where _init.php stops working. If the class is declared in config.php it works fine - but is this the recommended way or is there a better solution for this?
  5. I am running into the same issue. Unfortunately I wasn't able to reproduce it isolated, but it happens constantly in my current setup during debugging. Has this issue been solved for you @FrancisChung or is it still happening for you as well?
  6. thanks for bringing this up. To me this means: a cronjob will always use the first defined host, as there's no $_SERVER variable available, aye? Unless for sure the cronjob is called via http (e.g. "curl https:host.../") Thanks for your feedback - helps a lot πŸ™‚
  7. I was wondering which logic is behind the httpUrl method when multiple hosts are availble? My config says $config->httpHosts = array('api.local', 'www.api.local', '10.0.1.10'); $page->httpUrl returns always api.local. In the current setup 10.0.1.10 would be appreciated. Is there any logic behind this or is just the first host taken for the httpUrl() call? Checking the code brings up this comment But: How is this runtime valued defined when I use this method in a hook?
  8. whoop. Perfect! Thanks for that link πŸ™‚
  9. I already checked the CaptainHook cheatsheet - only the httpUrl method for PageFiles is hookable. It looks as if hooking the counterpart for pages is not possible πŸ˜• I currently use httpUrl at many places in the code but the URLs need to be rewritten. When hooks are not appropriate: Is there a way to add a custom method for all pages (e.g. $page->myCustomPath()) which actually returns the URL I need?
  10. nahhh.... I found the issue. If I would have followed @LostKobrakai advice: serialize can cause unforseen issues. The above example works fine, but actually (and I didn't test this yesterday) I (un-)serialize the array before replacing one item. When I use the example and serialize WireArray before getting and replacing the element it simply does nothing but it shows the old item I guess I have to go with the "use pages for every item" solution which is much less error prone. thanks @kongondo for testing this
  11. I have a WireArray which holds objects of type WireData. I use WireArray because I would like to utilize the capabilities of using selectors to find items. My current use case is to find one specific item, modify one value and put it back to the WireArray. The code (simplified) looks like this: // fill the array $arr = new WireArray(); $item1 = new WireData(); $item1->text = "lorem ipsum"; $item1->identifier = "123"; $arr->add($item1); $item2 = new WireData(); $item2->text = "lorem ipsum"; $item2->identifier = "456"; $arr->add($item2); $item3 = new WireData(); $item3->text = "lorem ipsum"; $item3->identifier = "789"; $arr->add($item3); // use the array $myItem = $arr->get("identifier=456"); $myItem->text = "some other text"; // update the item in the array ? Is there any trick to store the modified item in the array again? Removing the old item does not work because I don't know how to retrieve the key of $myItem Adding the item just duplicates it Replace the old item does not work - it keeps the old item Any help is appreciated! I hope that there is a solution - otherwise I have to replace the whole construct with single pages (which would be overkill) Thanks a lot!
  12. thanks for your input. I think serializing is the way to go for now. The closest pw-way would be probably to create new templates holding all the data, but for now this would be overkill πŸ˜‰
  13. I was wondering if there's a PW-way to store a WireArray permanently in a field and restore the WireArray whenever needed. Currently I can only think of (un)serialize or getArray() and then storing the array as JSON. It there's no better way - fine. If there is something more PW-related, I'd be happy if you share it πŸ™‚ Thanks!
  14. as usual: Layer8 problem. πŸ˜„ I just messed up with the field names. It works as expected as shown in the example above.
  15. @LostKobrakai, that was one of my thoughts as well. But I am building a form in a frontend template without any PW javascript (at least I am not aware of that). And because of that I tested if this is probably only a backend functionality in PW admin - but as said: it works as soon as the requiredIf is related to a text field. But anyways: I recognized that the Datetime field has some issues anyway. It's worth fixing them first πŸ˜‰
Γ—
Γ—
  • Create New...