• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CodeExtinguisher 2.0 Release Candidate 14.2

[eluser]Majd Taby[/eluser]
primary_key: howto_id (on one line)

Also, the way i would have done it would be to make a new plugin, not modify the original. It would make the code _much_ simpler, and it would also make it much easier to upgrade. In this situation, inheritence can really work for you and you would only need to overload the prepForDb (IIRC) method. Take a look at the dbdropdown plugin for an example.

[eluser]fender21[/eluser]
How can I define the custom link table name when using OneToMany? I have three tables, the festivals table is the parent, artists is the (many) and the festival_artist_link is the table used to build the onetomany relationship.

Festivals
Artists
festival_artist_link

[eluser]JeremyL[/eluser]
[quote author="jTaby" date="1220140748"]primary_key: howto_id (on one line)

Also, the way i would have done it would be to make a new plugin, not modify the original. It would make the code _much_ simpler, and it would also make it much easier to upgrade. In this situation, inheritence can really work for you and you would only need to overload the prepForDb (IIRC) method. Take a look at the dbdropdown plugin for an example.[/quote]

Thanks for the clarification, works great.

One other question though. I am not sure what you mean by using a new plugin. I am not making any plugins, so I'm not sure what you are suggestion to me (or if that part was meant for me)

[eluser]fender21[/eluser]
[quote author="Rob Stefanussen" date="1219309259"]Paul, thanks for the tips, I was able to get it working! I thought you might like to know about a little discovery I made while I was at it. At first, I was using the naming my YML with "_form", but that wasn't working. After digging around in the code, I found out what was going on. From what I can tell, there's nothing special about "_form" to CodeEx.

You can either do your CRUDs using a custom controller, or use the default controller. Right now, I'm using the default controller until I have a better handle on things. The reason YMLs don't need the form_setup directive is because it's defined in the $config array in the controller. It turns out that the trick is in the naming of the linking table and the foreign keys, which I wasn't able to figure out until I read your reply. I was a bit disappointed that CodeEx relies on an inflexible naming convention for this, but beggars can't be choosers, right?

I was able to get my tables linked up with these YMLs:

music.yml
Code:
form_setup:
    music_name:
        class: TextBox
    people:
        class: ManyToMany
        params:
            display_field: last_name
    music_types:
        class: ManyToMany
        params:
            display_field: music_type

music_types.yml

Code:
form_setup:
    music_type:
        class: TextBox

I hope this helps clear things up, someone please let me know if I'm way off base!

Thanks, Paul[/quote]

Paul & Rob,
Thanks for detailing this as I've spent around 2-3 hours today trying to get this to work. In the end, I am unable to because of the fact that OneToMany demands that you conform to the table definitions which will not work in my case. I've been figuring out how to try and hack out OneToMany and ManyToOne to accept all the parameters needed for folks with non-standard column names. We'll see what I can hack out!

[eluser]JamesL[/eluser]
JTabby,

I realized when testing the admin area I built with CodeExtinguisher that the image upload plugin you built does not change spaces in the filename to underscores. I wanted to let you know, it is a small detail but one I thought you might want to change.

Thanks again for all the great code.

JamesL

[eluser]hoojamaflip[/eluser]
Hi Jtabby,

I've been using CE for a bit and i've made a new plugin to produce a textfield that adds tags using the freetag tagging class.

The ideal thing would be to override the postInsertHook method but i can't seem to get it to work..

i've had it working using the prepForDb method, so you can add tags once you've added a new record, but when you add a new record it doesn't seem to be triggering the postInsertHook method. I've tried throwing errors inside the plugin's postInsertHook but it doesn't throw them.

any ideas? or am i just being stoopid and missing something simple.

thanks in advance

Tim

[eluser]Majd Taby[/eluser]
I would try adding an echo to libraries/codexforms.php in the iterate() function to see what functions it's calling.

[eluser]hoojamaflip[/eluser]
Got it! - it's a slightly older version and it was inside a fieldset - it's pre-formcontainer plugin so it wasn't passing the postInsertHook call through to items inside the fieldset.

thankyou Smile

[eluser]Unknown[/eluser]
I've used CodeEx for the admin side of my app successfully.
But I have one extra wish:
I want the public to be able to add one kind of object to my db, with restrictions of course (I will add a CAPTCHA, and public-added-objects will require approval).

So I guess my question is:
Can I use CodeEx to expose the "Create" part of the crud to the public (but not the RUD),
while using a different form (fields & design) than the one I use as admin?

[eluser]trkan[/eluser]
Great tool!!!
Looks like there are no more RC's.

My question is, how can you have a primary key in a table with '/' in it?
ie

http://www.google.com/search?q=

ps: for now i'm replacing all '/' with '^' both in the view and the controller. I'm happy to hear all other solutions Smile


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.