/** * array'den link oluşturur * * @param array $arr * @return strıng */ private static function arrayToUrl(array $arr) { $url = ''; foreach ($arr as $name => $value) { if ($name == 'page') { $url .= trim($value) . '?'; } else { $url .= $name . '=' . Form::setInput(trim($value)) . '&'; } } return preg_replace('/\\?$|&$|=$|=+&$/', '', $url); }
/** * sayfa redirect yapar * * @param string $url */ public static function redirect($url) { if (!headers_sent()) { header("Location: {$url}"); } else { if (preg_match('/api\\./', $_SERVER['SERVER_NAME'])) { $API = new Api(); $API->setReturn(false); $API->setData($url); $API->setMessage('Sayfa Yönlendirme'); echo $API->get(); } else { printf("<script type=\"text/javascript\">window.location.href='%s'</script>", Form::setInput($url)); } } exit(0); }
/** * Creates the head of the form. * * @param ModelForm $form */ protected function prepareHeadForm(ModelForm $form) { $this->output = "<form name='input' action='{$form->getAction()}' method='{$form->getMethod()}'>"; }
/** * Check if the submit form value use the show command to debug. * * @param string $coord * @return bool */ public function isDebug() { $coords = $this->form->getParameterData('coord'); return !is_null($coords) && 'show' == $coords; }