示例#1
0
 public function __construct()
 {
     $config = new Config();
     $connectionOptions = $config->getParamsArray();
     $devMode = $config->getDevMode();
     $entities = array("");
     $proxies = '../models/proxies/';
     $doctrineConfig = Setup::createAnnotationMetadataConfiguration($entities, $devMode, $proxies);
     $this->em = EntityManager::create($connectionOptions, $doctrineConfig);
 }
示例#2
0
 public function index()
 {
     $config = new Config();
     $data['todo'] = 'todo';
     $data['root'] = $config->getWebRoot();
     $data['home_url'] = $config->getHomeURL();
     $this->view->getView('header', $data, true);
     $this->view->getView('todo', $data, true);
     $this->view->getView('footer', $data, true);
 }
示例#3
0
 public function index()
 {
     $user = new User();
     $config = new Config();
     $current_user = $user->getUser();
     $todo = new todo\Todo();
     $task = $user->getTask();
     $data = array();
     $data['title'] = 'Sample TODO App';
     //		$data['firstname'] = $current_user->getName();
     //		$data['task'] = $task->getTaskName();
     $data['message'] = 'Here is a message created in our Home controller';
     $data['root'] = $config->getWebRoot();
     $data['home_url'] = $config->getHomeURL();
     // Lets load our views
     $this->view->getView('header', $data, TRUE);
     $this->view->getView('home', $data);
     $this->view->getView('footer', $data, TRUE);
 }
示例#4
0
/**
 * Doctrine command line file so we can run Doctrines SchemaTool and generate our
 * required tables.
 */
/** Vendor Directory Constant */
define('VENDOR_DIR', 'vendor/');
/**
 * Require Composers Autoloader
 */
require 'vendor/autoload.php';
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use GrassRootsMVC\Configs\Config;
$config = new Config();
$config->configArray = $config->setConfigs();
/**
 * This will retrieve our connection parameters so we can connect.
 *
 * @var  $connectionOptions
 */
$connectionOptions = $config->setDbParamsArray();
/**
 * If true caching is done in memory with the ArrayCache. Proxy objects are recreated on every request.
 * See docs for more information: http://doctrine-orm.readthedocs.org/en/latest/reference/configuration.html
 *
 * @var  $isDevMode
 */
$devMode = $config->getDevMode();
/**