Esempio n. 1
0
 public function executeAsset($request)
 {
     try {
         $controller = new Dynamics_Controller(sfDynamics::getInstance()->getConfiguration());
         $result = $controller->run($request->getParameter('name'));
         $this->response->setContentType($controller->getContentType());
         return $this->renderText($result);
     } catch (Exception $e) {
         throw new sfError404Exception($e->getMessage());
     }
 }
Esempio n. 2
0
 public static function run($filenames, $paths = array())
 {
     $name = self::getName();
     // create objects
     $configuration = new Dynamics_Configuration(array(Dynamics_Configuration::GLOBAL_ASSET_PATHS => $paths));
     $configuration->loadFromFiles($filenames);
     $dynamics = new Dynamics($configuration);
     $controller = new Dynamics_Controller($configuration);
     // run it
     $result = $controller->run($name);
     // display
     header(sprintf('Content-type: %s', $controller->getContentType()));
     die($result);
 }