Exemplo n.º 1
0
 protected function setDefaultAssign()
 {
     $this->showSetMessages();
     if (!$this->app->configIsEmpty('localTest')) {
         $this->app->getTemplateEngine()->assign(array('localTest' => $this->app->config('localTest')));
     }
     $this->app->getTemplateEngine()->assign(array('isLogin' => false, 'baseUrl' => $this->app->config('baseUrl'), 'themeUrl' => $this->app->getTheme()->getPublicBaseUrl(), 'xmlLang' => $this->app->getXmlLang(), 'language' => $this->app->getLanguage(), 'clientConfig' => $this->app->clientConfig(), 'isAjax' => $this->app->isAjax(), 'params' => $this->params, '_path' => array('route' => $this->getControllerPath(), 'action' => $this->getCurrentAction())));
     $this->setAdditionalAssign();
 }
Exemplo n.º 2
0
 public function testSmartyInstall()
 {
     $config = new Config();
     $config->setProtectedFromArray(array('publicDir' => 'public/', 'caching' => 1, 'theme' => 'default', 'basePath' => realpath(__DIR__ . DIRECTORY_SEPARATOR . 'App') . DIRECTORY_SEPARATOR, 'baseUrl' => 'http://localhost/skully/', 'languages' => array('en' => array('value' => 'english', 'code' => 'en')), 'urlRules' => array('' => 'home/index', 'admin' => 'admin/home/index'), 'namespace' => 'App'));
     if (!file_exists(realpath(__DIR__ . '/App/App/smarty/plugins'))) {
         mkdir('./App/App/smarty/plugins');
     }
     if (!file_exists(realpath(__DIR__ . '/App/App/smarty/cache'))) {
         mkdir('./App/App/smarty/cache');
     }
     if (!file_exists(realpath(__DIR__ . '/App/App/smarty/configs'))) {
         mkdir('./App/App/smarty/configs');
     }
     $app = new Application($config);
     $smarty = $app->getTemplateEngine()->getEngine();
     $errors = array();
     $smarty->testInstall($errors);
     echo "smarty errors: ";
     print_r($errors);
     $this->assertTrue(count($errors) <= 2);
 }