Skip to content

Instantly share code, notes, and snippets.

@Graceas
Graceas / playlist.m3u
Created November 6, 2019 09:18
Novotelecom tv playlist
#EXTM3U
#EXTINF:-1,Первый
http://37.192.100.141:81/udp/239.1.15.1:1234
#EXTINF:-1,Россия 1
http://37.192.100.141:81/udp/239.1.15.2:1234
#EXTINF:-1,НТВ
http://37.192.100.141:81/udp/239.1.15.4:1234
#EXTINF:-1,Пятый
http://37.192.100.141:81/udp/239.1.10.3:1234
#EXTINF:-1,РЕН-ТВ
/**
* Init phone verification
*
* @return Response
* @throws Exception
*/
public function phoneVerificationAction()
{
$em = $this->getDoctrine()->getManager();
$request = $this->getRequest();
@Graceas
Graceas / form.js
Created September 10, 2013 06:27
Symfony 2 used FormErrorsSerializer.php with jQuery.
function form_callback(target)
{
target = $(target);
$.ajax({
url: target.attr('action'),
type: target.attr('method'),
data: target.serialize(),
dataType: 'json',
beforeSend: function() {
//clear errors
@Graceas
Graceas / FormErrorsSerializer.php
Created September 10, 2013 06:26
Symfony 2 Form Error Serializer. May be used for AJAX form validation. Allows tree and flat array styles for errors.
class FormErrorsSerializer {
public function serializeFormErrors(\Symfony\Component\Form\Form $form, $flat_array = false, $add_form_name = false, $glue_keys = '_')
{
$errors = array();
$errors['global'] = array();
$errors['fields'] = array();
foreach ($form->getErrors() as $error) {
$errors['global'][] = $error->getMessage();