Editor php - post proccess event
Editor php - post proccess event
Hi,
trying to implement a complexe auth system, I would love to be able to add arbitrary datas to ajax returned by editor php.
I know that I can do that at the end of the php page by using data() instead of json(), but I would need a method in the editor php api. May be a post process event, that would allow us to add or even change data before json encoding
This discussion has been closed.
Replies
I'm not quite clear on why you would need a method in the Editor API rather than just using the
Editor->data()
method that you mentioned?Allan
Well the reason is that I would like to be able to treat all my datatables instance (I've got a lot) with a single method that I would use just after Editor initialisation, like that
$editor = Editor::inst( $db, 'mytable' );
$editor = myCustomFunction( $editor);
This method would also contains security checks using the create and update events, as well as a log system
I'm not entirely clear why you can't do what you describe already I'm afraid. Can you not just have your custom function execute the
Editor->process()
method and then do whatever post process is required. You could have a second function that would do the post process, or even pass in a callback.Allan
Thanks Allan, your absolutely right
I was misunderstanding things.