This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function executeLogin(sfWebRequest $request) | |
{ | |
$this->form = new LoginForm(); | |
if ($request->isMethod('post')) | |
{ | |
$this->form->bind($request->getParameter('login')); | |
echo $request->getParameter('login[login]'); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
categorie: | |
tableName: categories | |
actAs: | |
Timestampable: ~ | |
Sluggable: | |
unique: true | |
fields: [titre] | |
canUpdate: false | |
columns: | |
titre: { type: string(100), notnull: true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->f_reponse = Doctrine_Query::create() | |
->select('p.*, u.*') | |
->from('post p') | |
->leftJoin('p.user u') | |
->where('p.subject_id = ?', $this->f_sujet->getId()) | |
->execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Login=''; | |
$Password=''; | |
$Tab[100]; | |
$j=0; | |
for ($i=48;$i<59;$i++){ | |
$Tab[$j]=$i; | |
$j++; | |
} | |
for ($i=65;$i<91;$i++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function isAccessOk((array)$abonnements, (array)$userGroupes) | |
{ | |
$abonnements = array_flip($abonnements); | |
$userGrp = array_flip($userGroupes); | |
$at = array_merge($abos, $userGroupes); | |
return (bool)(count($at)<(count($abonnements)+count($userGroupes))); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function slugify($text) { | |
$alphabet = array( | |
'Š'=>'S', 'š'=>'s', 'Ð'=>'Dj','Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', | |
'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', | |
'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', | |
'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss','à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', | |
'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', | |
'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyController | |
{ | |
public function myAction(Request $request, App $app) | |
{ | |
$pager = new Pagination(); | |
$pager->nbreResult = 100; | |
if($request->getParam('nbreItemPage')!=$app->param->defaultNbreItemPage): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(isset($_FILES['fileform']) && !empty($_FILES['fileform']) && $_FILES['fileform']['error']!=4): | |
$uniqidname = uniqid('pub_'); | |
$directory = 'static/upload/'.rand(0,9).'/'; | |
$ObjFichier = new upload($_FILES['fileform']); | |
$ObjFichier->TypesValides = array('image/jpeg','image/png','image/gif'); | |
$ObjFichier->NewNom = $uniqidname; | |
$t = $ObjFichier->UploadFichier($directory) or die($ObjFichier->UploadErreur()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(isset($_FILES['fileform']) && !empty($_FILES['fileform']) && $_FILES['fileform']['error']!=4): | |
$uniqidname = uniqid('pub_'); | |
$directory = 'static/upload/'.rand(0,9).'/'; | |
$ObjFichier = new upload($_FILES['fileform']); | |
$ObjFichier->TypesValides = array('image/jpeg','image/png','image/gif'); | |
$ObjFichier->NewNom = $uniqidname; | |
$t = $ObjFichier->UploadFichier($directory) or die($ObjFichier->UploadErreur()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Nom du fichier qui enregistre les logs (attention aux droits à l'écriture) | |
ini_set('error_log', dirname(__file__) . '/log_error_php.txt'); |
OlderNewer