I thoroughly enjoyed your ZF2 Tutorial with Rob, and Experience from the trenches talk, at ZendCon. Albeit I only managed to get my feet wet during the tutorial, even with your direct help.
Question: I have been trying to integrate Propel ORM as a service into my application, but I’m not succeeding yet. Propel itself works just fine. Integrating with ZF2 it at runtime (see below) is what’s giving me trouble.
1) Is it possible?
2) What do you think is the best approach, best practice? Do I need to create my own “PropelService” module that interfaces between ZF2 and Propel during runtime? Propel has its own class autoloader, etc…
3) Here are the final “integration” steps described at :
This is the final step: initialize Propel in your PHP script. You may wish to do this step in an init or setup script that is included at the beginning of your PHP scripts.
Here is a sample initialization file:
<?php
// Include the main Propel script
require_once ‘/path/to/propel/runtime/lib/Propel.php’;
// Initialize Propel with the runtime configuration
Propel::init(“/path/to/bookstore/build/conf/bookstore-conf.php”);
// Add the generated ‘classes’ directory to the include path
I’m starting learn about zf2 to build the project
but are made to the form does not know how to get the data into a form select to select and insert into new database table.
Hi Evan,
I thoroughly enjoyed your ZF2 Tutorial with Rob, and Experience from the trenches talk, at ZendCon. Albeit I only managed to get my feet wet during the tutorial, even with your direct help.
Question: I have been trying to integrate Propel ORM as a service into my application, but I’m not succeeding yet. Propel itself works just fine. Integrating with ZF2 it at runtime (see below) is what’s giving me trouble.
1) Is it possible? 2) What do you think is the best approach, best practice? Do I need to create my own “PropelService” module that interfaces between ZF2 and Propel during runtime? Propel has its own class autoloader, etc…
3) Here are the final “integration” steps described at :
This is the final step: initialize Propel in your PHP script. You may wish to do this step in an init or setup script that is included at the beginning of your PHP scripts.
Here is a sample initialization file:
<?php // Include the main Propel script require_once ‘/path/to/propel/runtime/lib/Propel.php’;
// Initialize Propel with the runtime configuration Propel::init(“/path/to/bookstore/build/conf/bookstore-conf.php”);
// Add the generated ‘classes’ directory to the include path
set_include_path(“/path/to/bookstore/build/classes” . PATH_SEPARATOR . get_include_path());
Any advice would be greatly appreciated.
Thanks!
— Pascal
Hi Evan,
I’m starting learn about zf2 to build the project but are made to the form does not know how to get the data into a form select to select and insert into new database table.
you can do a small example?
thks so much
Hi,Evan.In the ‘loadModule.resolve’ section, you wrote the code ‘new $moduleName\Module’. It is wrong.It should be
$moduleName .= ‘\Module’; return new $moduleName;