jquery - How to communicate view and controller in a php project with out any type of framework -


Backgrad / Idea I am creating a web application from scratch; With any type of php structure. I'm building a web application like this; Because I want to learn php; And I think using a php framework will not make me a good php developer mame.

What have I done so far?

  • I create a project structure:
    • CSS
    • script
    • model
    • Resource

      I created a scene like this:

       < code> & lt; Html & gt; & Lt; Top & gt; & Lt ;! - Here I call my jquery.js - & gt; & Lt; Script & gt; Type: "Post", DataType: "Jason", Parameter: {var1: $ ("# var1" ) .val (), Method: "Singer"}) {...} ...) ... & lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Input id = "var1" name = "var1" type = "text" & gt; & Lt; Input ID "mybutton" name = "mybutton" type = "button" onclick = "action ();" & Gt; & Lt; / Body & gt; & Lt; / Html & gt;   

      My HomeControler.php

        and   

      Question

      I'm not really sure about this code (security). I want to know: In the suggested way, calls between ideas and controllers are called using any type of php structure?

      I have to call all these events and AJAX calls inside JX files, and just as you have an MVC structure Trying to use logical logic that handles URI routes.

        / Controller / Method / Ultimate 1 / Ultimate 2   

      In this way you will have a better code structure that is in your code above Something like that will happen.

        / home / signup / absolute 1 ......   

      For this, you must first divide it into sections for example URLs.

        $ controller = $ Segment [0] $ method = $ section [1] $ params = ... the rest of the segment   

      You can see whether the controller and the method exists or not, and if the number of standards in the method is given, try to see the source code of the Laval framework as a great job, I'm sure there are some ideas that you have You can choose.

  • Comments

    Popular posts from this blog

    Verilog Error: output or inout port "Q" must be connected to a structural net expression -

    jasper reports - How to center align barcode using jasperreports and barcode4j -

    c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -