0
votes

I have a new project structure. And I want to use propel.

I already setup composer and Propel 2.0. And I created 2 tables in a new database.

I created a php file that works, and I'm trying to access one of the tables.

I got this folder structure:

\mkte_circuitos
 \IMP
  \controller
   -process.php
  \model
   \Base
   \Map
    -Extra.php
    -Extratype.php
   -schema.xml   
 \vendor
  -composer.json
  -comoser.lock
  -propel.json
  -propel.json.dist

(note: Extra.php, Extratype.php is inside model folder, and inthe same level of Base and Map ( not inside map))

I will use "Extra" model class in process.php

It suppose that propel Autoload model classes ??

This is my propel.json.dist

{
    "propel": {
        "paths": {
            "schemaDir": "c:\\laragon\\www\\mkte_circuitos\\imp",
            "phpDir": "C:\\laragon\\www\\mkte_circuitos\\imp\\model"
        }
    }
}

I'm missing some configuration?

I created everything with propel init command, and it looks fine. But process can't find Extratype class.

Do I have to require_once some php file ??

Best Regards

1
Looks like an include is missing, have you tried composer dump-autoload?Qiniso

1 Answers

0
votes

You should rename propel.json.dist to propel.json, if that doesn't help, also try adding autoload in your composer.json like below

{
    ...
    "autoload": {
    "classmap": ["generated-classes/"]
  }
}