File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88use Phalcon \Mvc \View ;
99
1010define ('BASE_PATH ' , dirname (__DIR__ ));
11- define ('APP_PATH ' , BASE_PATH . '/app ' );
11+ define ('APP_PATH ' , BASE_PATH . '/src ' );
1212
1313// Register an autoloader
1414$ loader = new Loader ();
15- $ loader ->setDirectories (
16- [
17- APP_PATH . '/controllers/ ' ,
18- APP_PATH . '/models/ ' ,
19- ]
20- )
21- ->register ()
15+ $ loader
16+ ->setDirectories (
17+ [
18+ APP_PATH . '/controllers/ ' ,
19+ APP_PATH . '/models/ ' ,
20+ ]
21+ )
22+ ->register ()
2223;
2324
2425// Create a DI
4041
4142// Set the database service
4243$ container ['db ' ] = function () {
43- return new DbAdapter ([
44- "host " => 'localhost ' ,
45- "username " => 'your_db_user_name ' ,
46- "password " => 'your_db_password ' ,
47- "dbname " => 'tutorial ' ,
48- ]);
44+ return new DbAdapter (
45+ [
46+ "host " => 'tutorial-mysql ' ,
47+ "username " => 'phalcon ' ,
48+ "password " => 'secret ' ,
49+ "dbname " => 'phalcon_tutorial ' ,
50+ ]
51+ );
4952};
5053
5154// Handle the request
5255try {
53- $ application = new Phalcon \ Mvc \ Application ($ container );
56+ $ application = new Application ($ container );
5457 $ response = $ application ->handle ($ _SERVER ["REQUEST_URI " ]);
5558 $ response ->send ();
5659} catch (Exception $ e ) {
You can’t perform that action at this time.
0 commit comments