Menu

Not Powerful enough

Khurram
2005-01-29
2013-03-07
  • Khurram

    Khurram - 2005-01-29

    I'm a long time PHP Fusebox 3 user and am having a hard time switching to Fusebox 4.  As a matter of fact, I don't think I will be doing it for the simple purpose that its not powerfull enough...

    Although Fusebox 4 has some nice features like calling any fuse from inside any circuit and calling fuses at specified intervals, the simple problem is that circuit.xml is not powerul enough.

    In fusebox 3, it is easy to diagram a fuse entirely in the fbx_switch.php file.  For example..

    case "register":
       // include the form builder...
       include("frm_register_form_builder.php");
       if (isset($attributes[submit]))
       {
             // check the form...
             include("chk_register_form.php
             if ($goodform)
             {
                    // form variables are good process it.
                    include("act_register_user.php");
                    break;
             }
        }
        include("dsp_show_register_form.php");
        break;

    However, this is not possible in Fusebox 4 because nested Ifs are not allowed in the circuit.xml file.

    Some people may not like the code that I have posted above, but that is the logic you would need to implement a simple Register Form.  In Fusebox 3, taking a look at the circuit file gave you a complete look at how the particular fuses worked.  In Fusebox 4, I will have to include a "Controller File" which will then have to encompass the above logic and include the necessary files using the php "include()" function.  Which makes circuit.xml a very week construct.

    I hope in the future versions, nested Ifs are allowed.

    Khurram Khan

     
    • Khurram

      Khurram - 2005-01-29

      One more thing,  Fusebox 3 allowed you multiple breaking points.

      For example, in the above example, after act_register_user.php was processed, you would break out of the switch and dsp_show_register_from.php would not be processed.

      Any idea of how to do these things in Fusebox 4.

       
    • Damien Mc Kenna

      Damien Mc Kenna - 2005-06-24

      I thought FB4.1 allowed nested IFs?

       
    • Mike Ritchie

      Mike Ritchie - 2005-07-07

      You can't have nested ifs, but you can have dos to private fuseactions you set up in the same circuit, directly below the main one. Your register fuseaction is entirely possible in fusebox 4, you just need to write it a bit differently. By using the <do/>, you gain the added benefit of creating atomic fuseactions that can be used by other fuseactions as well

          <fuseaction name="register">
              <include template="frm_register_form_builder"/>
              <set name="showRegform" value="return true;" evaluate="true"/>
              <if condition="isset($attributes[&apos;submit&apos;]">
                  <true>
                      <!-- check the form -->
                      <do action="p_register"/>
                  </true>
              </if>
              <if condition="$showRegform === true">
                  <true>
                      <include template="dsp_show_register_form"/>
                  </true>
              </if>
          </fuseaction>
          
          <fuseaction name="p_register">
              <include template="chk_register_form"/>
              <if condition="$goodform">
                  <true>
                      <!-- form variables are good process it. -->
                      <include template="act_register_user"/>
                      <set name="showRegform" value="return false;" evaluate="true"/>
                  </true>
              </if>
          </fuseaction>

       
    • tgknight

      tgknight - 2005-12-01

      In 4.1 you can use nested ifs, I utilize them in my applications

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.