Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function handleExportToCockatrice()
- {
- $template = $this->createTemplate();
- $template->setFile('...');
- $cards = $this->db->table("cards");
- $cardsPath = array();
- foreach ($cards as $card) {
- $cardsPath[$card->id] = $url . "cards/" . Nette\Utils\Strings::webalize($card->name) . ".png";
- }
- $template->cardsXml = $cards;
- $template->paths = $cardsPath;
- $tmpFile = $this->context->expand('%tempDir%/cardXml/' . $this->user->id '.xml');
- $template->save($tmpFile);
- $this->sendResponse(new FileReponse($tmpFile));
- }
Advertisement
Add Comment
Please, Sign In to add comment