View more context

 

guttmann

Controller::curr()->getRequest() ?

👍 (1)
taoceanz

Controller::curr()->getRequest() works, thanks @guttmann. Will do the check, thanks for the tip, @MichalKleiner

Matt Lang

Is there a way I can make sure I get a link without ?stage=stage? I’m using $myModel->MyRelatedPages()->first()->Link(). What I want is just the normal link to the latest published version of that page, not with stage=stage appended.

Matt Lang

Elsewhere I’ve gotten around this with Versioned::get_by_stage('MyPage', Versioned::LIVE)->byID($id)->Link() But because it’s a many_many relation I don’t easily have the ID of the related model. It’d be nice if there were something available like $myModel->MyRelatedPages()->first()->latestPublishedVersion()->Link()

lerni

I asked myself this a few times and ended up with something like:

  1. $pharsedURL = parse_url(...);
  2. $url = $pharsedURL['scheme'] .'://'. pharsedURL['host'] . $pharsedURL['path'];

natino45

Is there a way to prevent external JavaScript requirements with "&" converted to "&" ?