/** * theme creator * returns a new view instance * * @param string $file * @param array $data * @param bool $encode * @return CCView */ public static function create($file = null, $data = null, $encode = false) { $view = parent::create(static::view_namespace() . '::' . $file, $data, $encode); // set the asset holder path \CCAsset::holder('theme')->path = static::public_namespace(); // set the vendor path \CCAsset::holder('vendor')->path = 'assets/vendor/'; // you may ask why not just return the parent::create(bla bla.. directly? // i actually wanted to do something with that var view. So if you'r still // able to read this i completly forgot it. return $view; }
/** * CCAsset::code tests */ public function test_code_gen() { CCAsset::macro('test', '<:uri>'); CCAsset::holder('root')->path = '/'; CCAsset::add('foo.test', 'root'); CCAsset::add('bar.test', 'root'); $this->assertEquals('</foo.test></bar.test>', CCAsset::code('test', 'root')); }