Skip to content

Instantly share code, notes, and snippets.

@muskie9
Last active July 12, 2018 20:08
Show Gist options
  • Save muskie9/2c30f6243394d082a08d9c7cb7d44de1 to your computer and use it in GitHub Desktop.
Save muskie9/2c30f6243394d082a08d9c7cb7d44de1 to your computer and use it in GitHub Desktop.
<?php
namespace Foo\Bar\Baz;
/**
* url_handlers/routing would be required for this, could do a page class to reduce that portion of the code
*/
class InvitationRedemptionController extends Controller
{
public function index($request){
if(!$this->requestHasParams($request)){
//handle case where proper params aren't present
}
if($this->loginOrUpdateMember($request)){//method to handle login or update logic
$this->redirect($request->getVar('YourProductURL'));
}else{
//return error message
}
}
//additional supporting methods (requestHasParams(), loginOrUpdateMember(), any other methods you'd need to write)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment