Good day everyone.
I'm new in symfony and having a hard time learning it.
I am currently having a problem that I have been trying to solve for the past 3 days.
I google for possible solutions and found nothing. Though many experience the same problem, their solution is not related to my problem.
Help me please, for I am a little desperate to learn symfony and fix this error.
So here is my problem:
I am creating two drop down with dependencies.The first drop down is a list of Province, and when I choose a Province, automatically the second drop down will list the cities under the selected city.
I have created the drop down but I cant get the dependency to work.
Help me guys, I;m new to this.Here is what I have:
I am using a plugin called "sfDependentSelectPlugin"
config/doctrine/schema.yml
RefRegion:
connection: doctrine
tableName: ref_region
columns:
id:
type: integer(4)
fixed: false
unsigned: true
primary: true
autoincrement: true
rank:
type: integer(1)
fixed: false
unsigned: true
primary: false
notnull: false
autoincrement: false
short_name:
type: string(12)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
region_name:
type: string(60)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
nscb_code:
type: string(2)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Division:
local: id
foreign: region_id
type: one
foreignType: many
Division:
connection: doctrine
tableName: division
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
region_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
code:
type: string(100)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
name:
type: string(255)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
address:
type: string()
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
superintendent:
type: string(200)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
total_schools:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
elem_school_count:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
secondary_school_count:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
created_at:
type: timestamp(25)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
updated_at:
type: timestamp(25)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
relations:
RefRegion:
local: region_id
foreign: id
type: one
foreignType: one
my code in lib/form/doctrine/UsersForm.class.php
$this->widgetSchema['region_id'] = new sfWidgetFormDoctrineChoice(array(
'model' => 'RefRegion',
'add_empty' => 'Select...',
));
$this->widgetSchema['division_id'] = new sfWidgetFormDoctrineDependentSelect(array(
'model' => 'Division',
'depends' => 'RefRegion',
'add_empty' => 'Select...',
'ajax' => true,
));
And I am getting this error:
Unknown record property / related component "ref_region_id" on "Division"
Any ideas what I am doing wrong?I'm new in symfony. Any help will be very very appreciated.
Thanks
