Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. public function init()
  2. {
  3. $username = craft()->request->getQuery('username');
  4.  
  5. if ($username)
  6. {
  7. craft()->urlManager->setRouteVariables(array(
  8. 'username' => $username
  9. ));
  10.  
  11. craft()->runController('myPluginHandle/myPluginActionMethod');
  12. }
  13. }
  14.  
  15. class MyPluginController extends BaseController
  16. {
  17. protected $allowAnonymous = true;
  18.  
  19. public function actionDoIt($username)
  20. {
  21. // Do your thing.
  22.  
  23. $this->redirect('homepage');
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement