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

[eluser]edwardmolasses[/eluser]
hi there,

I'm trying to write my own plugin, and i'd like to have it allow text fields that don't exist in the database. I'm not completely sure how to go about this though since it seems like ce requires that the field be in the database. Then i'd take that input and use it during the insert to process data.

I have a couple of concerns:

1) how do i stop ce from handling the insert? I know there's the pre and post insert functions that i can overload, but do i need to tell ce to let me handle the insert all by myself?
2) for my overloaded pre or post insert functions, can i get access to all of the fields that have been submitted? I want to use a few of them to do some data processing before the insert
<br>
Well, i think i have some missing pieces in my understanding of the code extinguisher process. It would be very much appreciated if someone could point me in the right direction. Thank you!

[eluser]Majd Taby[/eluser]
1) Return NULL from prepForDb or prepForDisplay and CE will not process that data into the db
2) you can just access the $_POST array directly.

[eluser]edwardmolasses[/eluser]
[quote author="jTaby" date="1224199800"]1) Return NULL from prepForDb or prepForDisplay and CE will not process that data into the db
2) you can just access the $_POST array directly.[/quote]

thanks very much!

Also, i just was wondering if it's possible to add an input in the yaml file that doesn't exist in the db? For the overview display, it looks like ce looks for the field in the table specified in the controller. I would like to exclude some fields from that lookup if possible.

thanks again!

[eluser]Majd Taby[/eluser]
make getFieldName() return NULL

Also, check out this page
http://codeextinguisher.pbwiki.com/Events

[eluser]edwardmolasses[/eluser]
thanks again :-)

[eluser]edwardmolasses[/eluser]
hi there, another small question from me.

I was wondering how, through my plugin, i might control what value is seen in that plugin's field in the overview list?

thanks again.

[eluser]Majd Taby[/eluser]
prepForDisplay returns what value should be shown in the overview.

[eluser]edwardmolasses[/eluser]
[quote author="jTaby" date="1224646155"]prepForDisplay returns what value should be shown in the overview.[/quote]

cheers, thank you Smile

[eluser]edwardmolasses[/eluser]
I also was wondering if i wanted to redirect to another table after a successful edit, where would the best place be to put the redirect?

I was thinking i would put a hidden plugin of my own at the end of the yaml file, and within the post edit hook of that plugin i could have the redirect. Is that a good way?

[eluser]Majd Taby[/eluser]
at that point i would suggest you create a new method and overload the edit method, adding your own redirect. Take a look at the bundled example controller.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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