Event driven handler in PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • msch-prv@bluewin.ch

    #1

    Event driven handler in PHP

    I am fairly new to PHP. I started creating a variety of classes
    (calendars, input forms, combo boxes, etc. ) but I am running into code
    overhead when I integrate these objects (testing for POST, GETS,
    Cookies etc.).

    I am looking for an interrupt driven approach to handle event
    processing (akin to VB's GUI) to simplify interactions. Basically, I
    would like to create the objects to be displayed on the pages and then
    activate a page event handler to process ithe inputs. Currently I am
    using a mix of js, php and session cookies. But I don't like this
    hybrid approach.

    AFIK, PHP does not natively support event interrupt handling. Is there
    somewhere an add-on or a more elegant work-around to handle such
    situations?

    I read about Ajax, XML and related technologies. Is this the path to
    go? Thanks for any pointers and/or advice.

    Mark

  • Jerry Stuckle

    #2
    Re: Event driven handler in PHP

    msch-prv@bluewin.ch wrote:[color=blue]
    > I am fairly new to PHP. I started creating a variety of classes
    > (calendars, input forms, combo boxes, etc. ) but I am running into code
    > overhead when I integrate these objects (testing for POST, GETS,
    > Cookies etc.).
    >
    > I am looking for an interrupt driven approach to handle event
    > processing (akin to VB's GUI) to simplify interactions. Basically, I
    > would like to create the objects to be displayed on the pages and then
    > activate a page event handler to process ithe inputs. Currently I am
    > using a mix of js, php and session cookies. But I don't like this
    > hybrid approach.
    >
    > AFIK, PHP does not natively support event interrupt handling. Is there
    > somewhere an add-on or a more elegant work-around to handle such
    > situations?
    >
    > I read about Ajax, XML and related technologies. Is this the path to
    > go? Thanks for any pointers and/or advice.
    >
    > Mark
    >[/color]

    No, PHP doesn't support interrupt handling - but there's no need to.

    The php runs and builds the page. The code then sends the page to the browser
    and terminates. When you send input from the browser, a new process or thread
    is started to handle the input.

    One problem you will have is you can't "display an object" on a page. You can
    only write attributes to the page. So you have no object to return to the script.

    You could store the object in the $_SESSION and retrieve it later.

    But you really need to think in a different way. This is not VB, where you have
    one program running all the time. This is transactional - and is handled
    differently.

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • Chung Leong

      #3
      Re: Event driven handler in PHP


      msch-prv@bluewin.ch wrote:[color=blue]
      > I am fairly new to PHP. I started creating a variety of classes
      > (calendars, input forms, combo boxes, etc. ) but I am running into code
      > overhead when I integrate these objects (testing for POST, GETS,
      > Cookies etc.).
      >
      > I am looking for an interrupt driven approach to handle event
      > processing (akin to VB's GUI) to simplify interactions. Basically, I
      > would like to create the objects to be displayed on the pages and then
      > activate a page event handler to process ithe inputs. Currently I am
      > using a mix of js, php and session cookies. But I don't like this
      > hybrid approach.
      >
      > AFIK, PHP does not natively support event interrupt handling. Is there
      > somewhere an add-on or a more elegant work-around to handle such
      > situations?
      >
      > I read about Ajax, XML and related technologies. Is this the path to
      > go? Thanks for any pointers and/or advice.
      >
      > Mark[/color]

      The Prado framework might be what you're looking for
      http://www.pradosoft.com/. Haven't use it myself--I just saw the
      periodic announcements here.

      Since you're more comfortable with the event-driven approach, I suspect
      you'll be happier programming in ASP.Net.

      Comment

      • ImOk

        #4
        Re: Event driven handler in PHP

        Also look at AJAX

        msch-prv@bluewin.ch wrote:[color=blue]
        > I am fairly new to PHP. I started creating a variety of classes
        > (calendars, input forms, combo boxes, etc. ) but I am running into code
        > overhead when I integrate these objects (testing for POST, GETS,
        > Cookies etc.).
        >
        > I am looking for an interrupt driven approach to handle event
        > processing (akin to VB's GUI) to simplify interactions. Basically, I
        > would like to create the objects to be displayed on the pages and then
        > activate a page event handler to process ithe inputs. Currently I am
        > using a mix of js, php and session cookies. But I don't like this
        > hybrid approach.
        >
        > AFIK, PHP does not natively support event interrupt handling. Is there
        > somewhere an add-on or a more elegant work-around to handle such
        > situations?
        >
        > I read about Ajax, XML and related technologies. Is this the path to
        > go? Thanks for any pointers and/or advice.
        >
        > Mark[/color]

        Comment

        Working...