I use symfony 1.4.11 with doctrine. I have helper:
function filterwords($text){
$filterWords=array ('some','filter','words');
$filterCount = sizeof($filterWords);
for($i=0; $i<$filterCount; $i++){
$text = preg_replace('/\b'.$filterWords[$i].'\b/ie',"str_repeat('*',strlen('$0'))",$text);
}
return $text;
}
}
All works fine. But I want to make module, that administrator can add words to filter from backend. Is it possible to transfer data from the database to varaible $filterWords I have next schema:
Filter:
actAs:
Timestampable: ~
connection: doctrine
tableName: filter
columns:
word: {type: string(255), notnull: true}
I can make in helper something like this, and get word what I need :
$record = Doctrine_Core::getTable('Filter')->getWordFilter();
foreach ($record as $filter )
{
echo $filter ->getWord();
}
But I do not how to implement it im my function...
Sorry for my bad English.