Это методы хорошими? Как работает метод render () ? Кто -нибудь может объяснить мне это? < /P>
class Render
{
public static function render(string $path, array $args = [], $template_path = Config::TEMPLATE_PATH)
{
ob_start();
extract($args);
require $path;
$content = ob_get_contents();
ob_clean();
include $template_path;
}
public static function e(string $output)
{
return htmlspecialchars($output, ENT_QUOTES, false);
}
public static function redirect(string $url, array $params = [], int $status_code = 302)
{
$query = $params ? '?' . http_build_query($params) : '';
header("LOCATION: $url$query", $status_code);
exit;
}
}
class Validate
{
public static function validate_is_string(string $text, int $min = 1, int $max = 10000)
{
return mb_strlen($text) >= $min and mb_strlen($text) = $min and $num
Подробнее здесь: https://stackoverflow.com/questions/795 ... good-pract
Мобильная версия