To load data from the database, There is a very simple method :

In a config.yml file.

<?php
    // initialize database manager
    $databaseManager = new sfDatabaseManager();
    $databaseManager->initialize();
    $c = new Criteria();
    $c->add(SitePeer::DOMAIN, $_SERVER['SERVER_NAME']);
    $config = SitePeer::doSelectOne($c);
?>

all:
  site:
    id:          <?php echo $config->getId() . "\n" ?>
    user_id:     <?php echo $config->GetUserId() . "\n" ?>
    domain:      <?php echo $config->GetDomain() . "\n" ?>
    name:        <?php echo $config->getName() . "\n" ?>
    description: <?php echo $config->getDescription() . "\n" ?>
    keywords:    <?php echo $config->getKeywords() . "\n" ?>
    state:       <?php echo $config->getState() . "\n" ?>

And for use data in the layout for example :
echo sfConfig::get('config_site_id', 'It does not work');


Arnaud.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to