This file contains hidden or 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 creates url properly slug from $text | |
* | |
* @param string $text | |
*/ | |
public function slugify($text) | |
{ | |
// replace non letter or digits by - | |
$text = preg_replace('#[^\\pL\d]+#u', '-', $text); |
This file contains hidden or 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 foreach ($jobs as $i => $job): ?> | |
<tr class="<?php echo fmod($i, 2) ? 'even' : 'odd' ?>"> | |
<?php endforeach; ?> |
This file contains hidden or 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
function getFileExtension($file_name) | |
{ | |
return substr(strrchr($file_name, '.'), 1); | |
} |
This file contains hidden or 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
/** | |
* Metoda konfiguruje formularz | |
*/ | |
public function configure() | |
{ | |
$this->widgetSchema['cities'] = new sfWidgetFormChoice(array( | |
'expanded' => true, | |
'multiple' => true, | |
'choices' => Doctrine_Core::getTable('hall')->getListNameForOpenHall(), | |
'renderer_options' => array('formatter' => array($this, 'formatter')) |
This file contains hidden or 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
Single records: | |
SELECT column, COUNT(*) AS c | |
FROM table | |
GROUP BY column | |
HAVING COUNT(c) > 1 | |
All records: | |
SELECT * |
This file contains hidden or 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
UPDATE table SET column = REPLACE(REPLACE(column, '\r', ''), '\n', ''); |
NewerOlder