Reports with Symfony November 17th, 2007
I wondered what the easiest way was to create reports.
I looked into PM Report 4.1 by Zeke Walker, but did not think it would be what I needed.
So this is what I did:
edit the Peer class of your table, and add a function that will return the data that you will need in the report:
static function getAllRowsWithBlabla()
$con = Propel::getConnection(self::DATABASE_NAME);
$sql = 'SELECT * FROM '.self::TABLE_NAME.' WHERE a=1 ORDER BY nachname, vorname';
$stmt = $con->prepareStatement($sql);
$rs = $stmt->executeQuery(ResultSet::FETCHMODE_NUM);
Then in apps/myapp/modules/mytable/actions/actions.class.php add an action for the report:
public function executeReportVereinsmitglieder()
$this->items = MyTablePeer::getAllRowsWithBlabla();
Finally, create a success page:
My blabla report
$first = false;
echo ', ';
To disable some items for printing, I changed the css styles
in file apps/myapp/templates/layout.php:
Symfony I18N November 17th, 2007
I have changed the
Symfony Project November 17th, 2007
I enjoy using the symfony Web PHP Framework for a database/web application.
To make it run on a Debian Virtual Private Server:
add to file /etc/apt/sources.list this line:
deb http://www.symfony-project.com/get debian/
Then install the required packages:
apt-get install php-pear php5-symfony php5-mysql php5-xsl
See the “My First Project”-Tutorial for initialising your project.