umask is a command that determines the settings of a mask that controls how file permissions are set for newly created files(тыц).
$('#confirmForm').on('click', function (event) {
$.ajax({
url: '/confirm',
method: 'post',
dataType: 'json',
success: function (data) {
console.log(data);
}
});
});
<?php
session_start();
require_once '/vendor/autoload.php';
$router = new AltoRouter();
$router->map('GET|POST', '/confirm', 'Main::index');
if ($match = $router->match()) {
$path = explode('::', $match['target']);
$controllerName = 'Controller\\' . $path[0];
$controller = new $controllerName;
call_user_func_array([$controller, $path[1]], $match['params']);
} else {
header('Location: /404');
}
<?php
class Main()
{
public function index()
{
$service = new MainService();
$service->saveForm();
json_encode([
'success' => true,
'message' => 'Форма успешно сохранена'
], JSON_UNESCAPED_UNICODE);
}
}
SELECT * FROM
(SELECT A.*, ROWNUM RNUM FROM
(/*Основной запрос выборки со всеми JOIN, GROUP, HAVING, ORDER*/) A
WHERE ROWNUM <=5/*По какую запись выбирать (предел)*/)
WHERE RNUM >=1/*С какой записи выбирать (начальная позиция)*/;
function sendPostToUrl(url, post) {
var form = $('<form/>', {
action: url,
method: 'post',
target: '_blank',
style: {
display: 'none'
}
});
for (key in post) {
if ('message' === key) {
for (i in post[key]) {
form.append($('<input/>', {
type: 'hidden',
name: 'message[]',
value: post[key][i]
}));
}
} else {
form.append($('<input/>', {
type: 'hidden',
name: key,
value: post[key]
}));
}
}
form.submit();
}
$('#learn-more').on('click', function (event) {
event.preventDefault();
sendPostToUrl($(this).attr('href'), data);
});
$array = []; // массив ваших id-шников
$this->em->getRepository('%repoName%')->findBy(['id'] => $array);
<?php
namespace View;
use Controller\Error;
use Twig_Environment;
use Twig_Loader_Filesystem;
class TwigView implements IView
{
/**
* @var Twig_Environment
*/
private $twig;
/**
* @var Twig_Loader_Filesystem
*/
private $loader;
/**
* @var string
*/
private $template;
/**
* @var array
*/
private $params;
/**
* @param string $template Имя шаблона
* @param array $params Передаваемые параметры
*/
public function __construct($template, $params)
{
$this->loader = new Twig_Loader_Filesystem(TEMPLATE_DIR);
$this->twig = new Twig_Environment($this->loader);
$this->template = $template;
$this->params = $params;
}
/**
* @return string
*/
public function render()
{
try {
return $this->twig->render($this->template, $this->params);
} catch (\Twig_Error_Loader $e) {
$error = new Error();
$error->index404();
}
}
}
public function index()
{
$this->isAuthorized('users');
try {
$twig = new TwigView('Users/ShowAllUsers.twig',
[
'session' => $_SESSION,
'user' => $this->em->getRepository('Model\User')->getAll()
]
);
print $twig->render();
} catch (DatabaseException $e) {
$error = new Error();
$error->index1010($e->getMessage());
}
}