I put my code in the bootstrap:

$replacementsFolder = 'contentReplacements/';
$searchTemplate;
$searchContent = '';
$adSenseTemplate;
$adSenseContent = '';

$searchTemplate = $replacementsFolder . 'searchField.tpl';
$adSenseTemplate = $replacementsFolder . 'googleAdSense.tpl';

if ( file_exists( $searchTemplate ) ) {
        $fileHandler = fopen($searchTemplate, 'r');
        $searchContent = fread($fileHandler, filesize($searchTemplate));
        fclose( $fileHandler );
}

if ( file_exists( $adSenseTemplate ) ) {
        $fileHandler = fopen($adSenseTemplate, 'r');
        $adSenseContent = fread($fileHandler, filesize($adSenseTemplate));
        fclose( $fileHandler );
}

function parseContentItem( &$content ) {
        $content = str_replace('[BLZ-Suche]', $searchContent, $content);
        $content = str_replace('[Google AdSense]', $adSenseContent,
$content);

        return 0;
}




Cake gives me an error message and says that there is no variable
$searchContent and $adSenseContent.

Someone knows what this is about? When i declare the varibales as
globals within the function, they are empty.


Regards,
Benedikt
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to