| 1: | <?php |
| 2: | namespace Sphp\core { |
| 3: | class Router { |
| 4: | /** @var string $url_extension extension use in URL default is .html */ |
| 5: | public $url_extension = ".html"; |
| 6: | /** @var string $act Gate Action */ |
| 7: | public $act = ""; |
| 8: | /** @var string $sact Gate Event */ |
| 9: | public $sact = ""; |
| 10: | /** @var string $evtp Gate Event Parameter */ |
| 11: | public $evtp = ""; |
| 12: | /** @var string $gate Current Request Gate */ |
| 13: | public $gate = ""; |
| 14: | /** @var string $uri Request URI */ |
| 15: | public $uri = ""; |
| 16: | /** |
| 17: | * Advance Function, Internal use |
| 18: | */ |
| 19: | public function route() {} |
| 20: | /** |
| 21: | * Get Current Request Gate |
| 22: | * @return string |
| 23: | */ |
| 24: | public function getCurrentRequest() {} |
| 25: | /** |
| 26: | * Check if any Gate registered with current request |
| 27: | * @return boolean |
| 28: | */ |
| 29: | public function isRegisterCurrentRequest() {} |
| 30: | /** |
| 31: | * Register Current Request with Gate |
| 32: | * @param string $gate_dir_path Gate file path like Gates/index.Gate |
| 33: | * @param string $s_namespace Optional Namespace if any |
| 34: | * @param string $permtitle Title Display in Permission List |
| 35: | * @param array $permlist Create Permissions List for Gate |
| 36: | */ |
| 37: | public function registerCurrentRequest($gate_dir_path, $s_namespace = "",$permtitle="",$permlist=null) {} |
| 38: | /** |
| 39: | * Register Current Request with different App Gate |
| 40: | * @param string $gate <p> |
| 41: | * registerCurrentGate('home') |
| 42: | * </p> |
| 43: | */ |
| 44: | public function registerCurrentGate($gate) {} |
| 45: | public function isRootURI() {} |
| 46: | /** |
| 47: | * Get Registered Gate Path details of Current Request |
| 48: | * @return array |
| 49: | */ |
| 50: | public function getCurrentGatePath() {} |
| 51: | /** |
| 52: | * Get Registered Gate Path details |
| 53: | * @param string $gate Gate |
| 54: | * @return array |
| 55: | */ |
| 56: | public function getGatePath($gatea2) {} |
| 57: | /** |
| 58: | * Generate URL for a Gate |
| 59: | * @param string $gate_param Gate like index |
| 60: | * @param string $extra <P> Extra query string in URL |
| 61: | * $extra = 'test=1&mpid=13' |
| 62: | * </p> |
| 63: | * @param string $newbasePath <p> new domain url |
| 64: | * $newbasePath = 'https://domain.com/test |
| 65: | * </p> |
| 66: | * @param boolean $blnSesID Add session id default false |
| 67: | * @param string $ext change url file extension as Gate default empty and use html or set in comp file. |
| 68: | * @param boolean $noncache default false, if true, cache can not save this url in browser or in proxy |
| 69: | * @return string |
| 70: | */ |
| 71: | public function getGateURL($gate_param, $extra = "", $newbasePath = "", $blnSesID = false,$ext='',$noncache=false) {} |
| 72: | /** |
| 73: | * Generate URL for Current Gate |
| 74: | * @param string $extra <P> Extra query string in URL |
| 75: | * $extra = 'test=1&mpid=13' |
| 76: | * </p> |
| 77: | * @param boolean $blnSesID Add session id default false |
| 78: | * @param string $ext change url file extension as Gate default empty and use html or set in comp file. |
| 79: | * @param boolean $noncache default false, if true, cache can not save this url in browser or in proxy |
| 80: | * @return string |
| 81: | */ |
| 82: | public function getThisGateURL($extra = "", $blnSesID = false,$ext='',$noncache=false) {} |
| 83: | /** |
| 84: | * Generate Secure Event URL for a Event Parameter of Gate. |
| 85: | * If you try tamper the URL Event Parameter then it gives empty event parameter value. If you need |
| 86: | * to pass other value also secure then you need to manually secure with function |
| 87: | * val2Secure function and restore back with secure2Val function. By default event parameter |
| 88: | * automatically convert by SartajPHP. |
| 89: | * @param string $eventName <p> Name of Event |
| 90: | * class index extends Sphp\tools\BasicGate{ |
| 91: | * public function page_event_test($evtp){ |
| 92: | * |
| 93: | * } |
| 94: | * } |
| 95: | * $eventName = test |
| 96: | * $gate_param = index |
| 97: | * Registered Gate File = Gates/index.Gate |
| 98: | * </p> |
| 99: | * @param string $evtp Event Parameter pass to URL |
| 100: | * @param string $gate_param Gate like index |
| 101: | * @param string $extra <P> Extra query string in URL |
| 102: | * $extra = 'test=1&mpid=13' |
| 103: | * </p> |
| 104: | * @param string $newbasePath <p> new domain url |
| 105: | * $newbasePath = 'https://domain.com/test |
| 106: | * </p> |
| 107: | * @param boolean $blnSesID Add session id default false, url expired with session (Gate can allow expired url) |
| 108: | * @param string $ext change url file extension as Gate default empty and use html or set in comp file. |
| 109: | * @param boolean $noncache default false, if true, cache can not save this url in browser or in proxy |
| 110: | * @return string |
| 111: | */ |
| 112: | public function getEventURLSecure($eventName, $evtp = "", $gate_param = "", $extra = "", $newbasePath = "", $blnSesID = false,$ext='',$noncache=false) {} |
| 113: | /** |
| 114: | * Generate URL for a Event of Gate |
| 115: | * @param string $eventName <p> Name of Event |
| 116: | * class index extends Sphp\tools\BasicGate{ |
| 117: | * public function page_event_test($evtp){ |
| 118: | * |
| 119: | * } |
| 120: | * } |
| 121: | * $eventName = test |
| 122: | * $gate_param = index |
| 123: | * Registered Gate = Gates/index.Gate |
| 124: | * </p> |
| 125: | * @param string $evtp Event Parameter pass to URL |
| 126: | * @param string $gate_param Gate like index |
| 127: | * @param string $extra <P> Extra query string in URL |
| 128: | * $extra = 'test=1&mpid=13' |
| 129: | * </p> |
| 130: | * @param string $newbasePath <p> new domain url |
| 131: | * $newbasePath = 'https://domain.com/test |
| 132: | * </p> |
| 133: | * @param boolean $blnSesID Add session id default false, url expired with session (Gate can allow expired url) |
| 134: | * @param string $ext change url file extension as Gate default empty and use html or set in comp file. |
| 135: | * @param boolean $noncache default false, if true, cache can not save this url in browser or in proxy |
| 136: | * @return string |
| 137: | */ |
| 138: | public function getEventURL($eventName, $evtp = "", $gate_param = "", $extra = "", $newbasePath = "", $blnSesID = false,$ext='',$noncache=false) {} |
| 139: | /** |
| 140: | * Advance Function, Internal use |
| 141: | * @param string $evt |
| 142: | * @param string $evtp |
| 143: | */ |
| 144: | public function setEventName($evt, $evtp = "") {} |
| 145: | } |
| 146: | } |
| 147: |