This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » development » Feature requests » Combining symfony and php-gtk
Combining symfony and php-gtk [message #37926] Tue, 23 October 2007 09:41 Go to next message
jsamos  is currently offline jsamos
Messages: 2
Registered: October 2007
Location: Granada (Spain)
Junior Member
Hello!

Please, I would like to know if someone has some experience of using php-gth to develop the user interface in a symfony project. Would it be possible?

Best regards,

José
Re: Combining symfony and php-gtk [message #37943 is a reply to message #37926 ] Tue, 23 October 2007 11:34 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
Welcome to the fora.

I very much doubt anyone has tried what you suggest. Symfony is designed for the request-response paradigm of the web, and GTK on the other hand is designed for desktop applications. The user interface in a symfony project is created in a symfony template using "helpers" (functions included as required) and however this is done in PHP-GTK, it will be very different.


Remember Palestine
Re: Combining symfony and php-gtk [message #37947 is a reply to message #37943 ] Tue, 23 October 2007 11:44 Go to previous messageGo to next message
jsamos  is currently offline jsamos
Messages: 2
Registered: October 2007
Location: Granada (Spain)
Junior Member
Thank you for your answer.

I agree with you. But, it would be nice to have the possibity of building desktop applications using symfony. Only the "view" part should have to be changed.

Maybe the symfony development team could consider this posibility in future symfony versions.
icon11.gif  Re: Combining symfony and php-gtk [message #92343 is a reply to message #37926 ] Wed, 27 January 2010 21:26 Go to previous message
bashman  is currently offline bashman
Messages: 2
Registered: August 2008
Junior Member
Hello community!.
read:
http://www.symfony-project.org/book/1_2/16-Application-Manag ement-Tools
read:
Using symfony outside of a web context.

Here's one way:

<?php
require_once(dirname(__FILE__).'/config/ProjectConfiguration .class.php');
$configuration =
ProjectConfiguration::getApplicationConfiguration('principal ', 'prod',
false);
sfContext::createInstance($configuration);
// Remove the following lines if you don't use the database layer
$databaseManager = new sfDatabaseManager($configuration);
$databaseManager->loadConfiguration();
//obtiene el municipio 2 de la tabla de municipios
$x = MunicipiosPeer::retrieveByPK(2);
//for test
//echo $x->getMunmunicipio() . "\n";
//verificamos si php-gtk esta instalado y configurado

if (!class_exists('gtk')) {
die(":-P \r\n");
}
$wnd = new GtkWindow();
$wnd->set_title('Municipio N 2');
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));
$lblHello = new GtkLabel($x->getMunmunicipio() );
$wnd->add($lblHello);
$wnd->show_all();
Gtk::main();
?>

This is my example, very basic and without reading anything more. This can be improved and extended. You can use the model classes generated by symfony, you can choose your orm, and some other functions and features of the framework. Make no mistake. Apache is not needed, only php and php-gtk, a data model (schema.yml) and an RDBMS installed and operating correctly.

Do not panic. This is a proof/test of concept.

Please test and notify.

--
bashman
Previous Topic:IDE for Symfony
Next Topic:symfony task log
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software