<option value="6" label="_____Test7" selected="selected">_____Test7</option>
code looks like this
Code: Select all
foreach( $tree as $node )
{
$field->addMultiOption( $node['id'], str_repeat( str_repeat(' ', 5 ), $node['level']) . ucwords($node['name']) );
}I'm trying to just get a simple CRUD framework for myself going, where all I have to do is define models, and set a boolean to if the admin should be able to manage categories for that model. What I'm doing now is looking at the metadata of the doctrine active record object, iterating over the fields skipping fields I don't want on the current form ( I have a global list of "blacklisted" fields ).. works for prototype purposes but obviously this thing needs to be more powerful then that.
I was thinking a good solution would be to set up XML files or ini files that specify which fields should be ignored as far as showing them to the user, also some models may have many fields and I may only want a certain set of default fields in the "browse" or "list" screen.
Is there any way with doctrine, or any other tool to do what I'm talking about? Right now my schema looks like
Code: Select all
ContentVideo:
tableName: videos
actAs:
SoftDelete:
Timestampable:
created:
name: created_at
type: timestamp
format: Y-m-d H:i:s
updated:
name: updated_at
type: timestamp
format: Y-m-d H:i:s
columns:
id:
primary: true
autoincrement: true
type: integer(50)
title:
type: string(255)
description:
type: string
I want to also tell it which fields should be used in certain views, I looked over all documentation for my frameworks several times and searched for an answer as best I could, is there a cleaner way then setting up my own parallel schema files.. I mean if it came down to that I could have my schema files generate the doctrine schema for me, and just define it one place, but that seems a little redundant
All of doctrines code generation stuff is built into their API so you don't have to use physical schema files, I could implement my own schema that has model specific and form specific schema, and passes only the model schema to doctrine.. but it seems like a tool has to already exist for this
Is this an invention or an implementation? Does this exist?
i could just write parallel form schema files and load them into zend_form with zend_config, but that just seems so... tedious