Пример #1
0
 public function loadMeta(Connection $conn, $tablename)
 {
     self::$conn = $conn;
     self::$tablename = $tablename;
     $metamanager = new MetaManager();
     $data = self::$conn->fetchAll('select * from ' . self::$tablename . ';');
     $donneeTraitee = array();
     foreach ($data as $meta) {
         $donneeTraitee[$meta['name']] = $meta['value'];
     }
     $metamanager->setTitle($donneeTraitee['title']);
     $metamanager->setDescription($donneeTraitee['description']);
     $metamanager->setContentType($donneeTraitee['contentType']);
     $metamanager->setRobots($donneeTraitee['robots']);
     $metamanager->setOgTitle($donneeTraitee['ogTitle']);
     $metamanager->setOgUrl($donneeTraitee['ogUrl']);
     $metamanager->setOgSiteName($donneeTraitee['ogSiteName']);
     $metamanager->setOgDescription($donneeTraitee['ogDescription']);
     return $metamanager;
 }
Пример #2
0
 /**
  * Registers services on the given app.
  *
  * This method should only be used to configure services and parameters.
  * It should not get services.
  *
  * @param Application $app An Application instance
  */
 public function register(Application $app)
 {
     $app['fabricekabongoc.seomanager'] = $app->share(function ($app) {
         return MetaManager::loadMeta($app['db'], $app['fabricekabongoc.']['seooptions.meta.table']);
     });
 }