Skip to content

Instantly share code, notes, and snippets.

$(document).ready(my_function); //you have a function its name my_function. You can call this after page load
Or //bir fonsiyonunuz var diyelim adı my_function olsun. sayfa yüklendikten sonra böyle çağırabilirsiniz
$(document).ready(function () {
// Function code here. //buraya isterseniz kodlarınızı yazıp bir fonksiyon oluşturabilirsiniz
});
$date = new \DateTime('now'); // today (bugün)
$dogum_gunleri = $em->createQueryBuilder()
->select('p')
->from('CoreCommonBundle:YourEntity','p')
->where('p.school=:school')
->andWhere('p.birthday LIKE :birthday')// LIKE important
->setParameter('okul',$okul)
->setParameter('birthday', '%'.$date->format('m-d').'%')//this is important format must be (m-d) and must be %
$('table').dataTable({
"aaSorting": [[ 0, "desc" ]] // Sort by first column descending. (ilk kolona göre sıralama yapar)
//0 first colomn 1 second like a array (0 ilk kolon 1 ikinci array gibi )
});
$soft_delete_konular=$em->createQueryBuilder()
->select('s')
->from('CoreCommonBundle:Konu','s')
->where('s.isSoftDeleted =:delete')
->andWhere('s.gonderici =:gonderici OR 's.alici =:alici')
göndericisi x kişisi olan veya alıcısı x kişisi olan demek için OR araya konur
->setParameter('delete',1)
->setParameter('gonderici',$kimlik)
->setParameter('alici',$kimlik)
->getQuery()
@e-vural
e-vural / Symfony Giriş Yapan İp Adresini Alma
Last active October 1, 2015 14:38
from mehmet emre vural
$this->container->get('request_stack')->getCurrentRequest()->getClientIp();
app/config/parameters.yml
mailer_transport: gmail
mailer_encryption: ssl
mailer_auth_mode: login
mailer_host: smtp.gmail.com
mailer_user: [email protected]
mailer_password: şifreniz
app/config/config_dev.yml
if($this->get('security.authorization_checker')->isGranted('ROLE_YONETICI')){
}
<input type="text" style="text-transform:uppercase;" on keyup="javascript:this.value=this.value.toUpperCase();">
<input size="{{ musteri.adsoyad|length+2 }}" value="{{ musteri.adsoyad|upper }}" onkeyup="f(this)">
function f(bu){
if(bu.size) {bu.size=bu.value.length+2};
}
@e-vural
e-vural / Select 2 Şehir İlce Seçimi Jquery
Created July 13, 2015 16:10
Select 2 Şehir İlce Seçimi Jquery
/*
il gönderdik
*/
$("#il").select2({
maximumSelectionLength: 1,
allowClear: true,
theme: "bootstrap",
ajax:{
url: Routing.generate('sehir'),