Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. /**
  2. * Constructs the object
  3. *
  4. * @example:
  5. *
  6. * new Link ('users', 'edit', ['PARTY_ID' => 27], true) will result in
  7. * /ADMIN_PATH/users/edit?PARTY_ID=27
  8. * <a href="/ADMIN_PATH/users/edit?PARTY_ID=27" target="_blank"></a>
  9. *
  10. * @param string $module the module
  11. * to where the link is pointing to
  12. * @param string $action to controller/action
  13. * to where the link is pointing to
  14. * @param array $params the html params
  15. * to be added to the link the key is the
  16. * variable name and the value is the
  17. * value of the variable
  18. * @param boolean $blank true the link must be
  19. * open in a new tab, false it must not
  20. */
  21. public function __construct($module, $action, $params, $blank, $anchor = false) {
  22. $this->module = $module;
  23. $this->action = $action;
  24. $this->params = $params;
  25. $this->blank = $blank;
  26. $this->isTemplate = false;
  27.  
  28. $this->anchor = '';
  29. if (!empty($anchor)) {
  30. $this->anchor = '#' . $anchor;
  31. }
  32.  
  33. if ($this->blank) {
  34. $this->addAtribute('target', '_blank');
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement