コード例 #1
0
ファイル: Board.php プロジェクト: matheusheiden/TinyBoards
 public function getThreads()
 {
     /**
      * @var Post $collection
      */
     $collection = TinyBoard::getModel('\\TinyBoard\\Objects\\Post');
     $collection = $collection->getCollection(null, array("isOp" => 1, "board_id" => $this->getData('id')));
     return $collection;
 }
コード例 #2
0
 public function viewAction()
 {
     $id = array_keys($this->getRequest()->getUriAsGet());
     $id = reset($id);
     /**
      * @var \TinyBoard\Blocks\Board $layout
      * @var \TinyBoard\Objects\Board $board
      */
     $board = TinyBoard::getModel('\\TinyBoard\\Objects\\Board');
     if ($id) {
         $board->load($id, 'name');
     }
     //If board exists loads layout and renders it
     if (!$board->isNew()) {
         $layout = $this->loadLayout('Board');
         $layout->setBoard($board);
         $layout->renderLayout();
         return;
     }
     /**
      * @TODO CREATE 404 REDIRECT
      */
     $this->getResponse()->redirect(\TinyBoard\TinyBoard::getUrl());
 }
コード例 #3
0
ファイル: Main.php プロジェクト: matheusheiden/TinyBoards
<?php

ini_set('display_errors', 1);
include_once "TinyBoard.php";
echo '<pre>';
\TinyBoard\TinyBoard::app();
$post = \TinyBoard\TinyBoard::getModel('\\TinyBoard\\Objects\\Post')->load(1);
var_dump($post);
/*
$teste = new Renderer();
echo '<img src="data:image/png;base64,' . (string)$post->getImage(). '" />';
*/
コード例 #4
0
ファイル: Post.php プロジェクト: matheusheiden/TinyBoards
 /**
  * @return Image
  */
 public function getImage()
 {
     $image = TinyBoard::getModel('TinyBoard\\Objects\\Image')->getImagesFromPost($this);
     return reset($image);
 }
コード例 #5
0
ファイル: Boards.php プロジェクト: matheusheiden/TinyBoards
 public function getBoards()
 {
     return \TinyBoard\TinyBoard::getModel('\\TinyBoard\\Objects\\Board')->getCollection();
 }