Exemple #1
0
 public function getInstance()
 {
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Exemple #2
0
 public function __construct()
 {
     $ret = parent::__construct();
     $config = Pfw_Config::getConfig();
     $this->assignSiteTitle($config['site_title']);
     $this->setupPaths();
     return $ret;
 }
 public function testGenerateShowLinkTo()
 {
     $pfw_routes = $this->getPfwRoutes();
     Pfw_Loader::loadClass('Pfw_Controller_Front');
     $front = Pfw_Controller_Front::getInstance();
     $front->getRouter()->setRoutes($pfw_routes);
     $smarty = new Pfw_Smarty_Standard();
     $params = array('route' => 'default_show', 'controller' => 'foo', 'id' => '123', 'action' => 'bar');
     $link = $smarty->_generateLinkTo($params, 'hello world');
     $this->assertEquals(rtrim('<a href="/foo/123">hello world</a>'), rtrim($link));
 }