Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.


Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

how can i deal with the $_post parameters before write


6 Posts   2088 Views


23 June 2008 at 3:28pm Community Member, 9 Posts

when i create or update a page.

it there any function like onbeforexxxx and how can i get those parameters
directly get from $_POST or $_GET ???


23 June 2008 at 4:39pm Community Member, 604 Posts

I don't know if my method is correct or not, but I add functions for this in the page_controller class for the page I am viewing.

For example, I have a page type called Tour. I have a dropdown box for changing currencies on a page, and this simply refreshes the current page with ?cur=value on the URL. So in my Tour_Controller class, I simple add an init() method at the top (so it is called first when the page loads) and do something like this:

function init() {

if($_GET['cur']) {
// Do my stuff with $_GET['cur'] here



23 June 2008 at 4:42pm Community Member, 604 Posts

Oops, sorry mate - re-read your post and it seems you're talking about the CMS side of things. I have no idea on this sorry, and my post above won't be much good to you.



23 June 2008 at 4:57pm Community Member, 9 Posts

yes, the cms admin side. still thanks a lot.
my situation is i create a TestPage and add a new column , testvalue for eg.
and add it to the cms admin panel,where i can input the value

but on the serverside before save the value to the database , i want to change the testvalue.
do some validation or do some text2html things.


23 June 2008 at 6:24pm Forum Moderator, 5511 Posts

can you use onBeforeWrite() on your dataobject


23 June 2008 at 7:31pm Community Member, 9 Posts

another problem is how can i get the request parameter.
the name of the input is not the column of the db,so there is no getter and setter.
can you tell me when the program do getter and setter for the datamodel, where is the code?
i spent much time still can not found