Editor php - post proccess event

Editor php - post proccess event

perrotinperrotin Posts: 39Questions: 9Answers: 1

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

Replies

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin

    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

  • perrotinperrotin Posts: 39Questions: 9Answers: 1

    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

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin

    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

  • perrotinperrotin Posts: 39Questions: 9Answers: 1

    Thanks Allan, your absolutely right
    I was misunderstanding things.

This discussion has been closed.