Propel e portali – appunti utili… a me

Installazione Propel

just create a new composer.json file at the root of your project’s directory with the following content:

"require": {
"propel/propel": "~2.0@dev"


php composer.phar install

Per testarlo:

cd myproject
e lancia
export PATH=$PATH:/path/to/vendor/bin/
cd mkdir propel
mkdir propel/class
propel init
propel model:build
vim composer.json
"require": {
"propel/propel": "~2.0@dev"
"autoload": {
"classmap": ["propel/class/"]

php composer.phar dump-autoload

propel config:convert

nei file php:

require_once '';
// setup the autoloading
require_once 'vendor/autoload.php';
//require_once 'vendor/autoload.php';
// setup Propel
require_once 'generated-conf/config.php';

e poi:


echo $avviso->getAvviso();
$d1=new DateTime(“2012-07-08 11:14:15.638276”);
echo $d1->format(‘Y-m-d H:i’);
echo $avviso->getDtAvviso()->format(‘Y-m-d H:i’);
$newDate = $avviso->getDtAvviso();
$newDate = $newDate->format(‘Y-m-d H:i:s’); // for example