How to organize my project and be more productive?

Asked

Viewed 43 times

0

Good evening guys, I’m a beginner let’s say so, and I’m having a hard time organizing my project, because even knowing what I want I don’t know the order of the steps to complete my goal, and I find myself lost several times

I tried some tips I saw in other posts but nothing helped me, I even tried github.

Someone could share the experiences and how it is organized to create the projects

I am currently building an e-commerce web system (PHP/Mysql

I know there were already posts of the type on the forum but none of the tips helped me much

Thank you!

1 answer

1


Hello, Jose, welcome to Stackoverflow.

Well... I’m not advanced in PHP, but what I do with my projects currently as regards the file structure:

|-root
---|class
------>Busca.class.php
---|php
------>busca.php
---|plugins
-------|bootstrap
-------|jQuery
---|view
-------index.php
---|js
-------index.js

Explaining basically: in class are all the classes that I did in PHP to do mainly BD access functions, such as data entry and search. Already on php are the files of "control" php, which is where a form goes when the user clicks on the button submit.

You can do it in a simple way:

--index php.

<html>
<form action="busca.php" method="POST">
   <input type="hidden" name="form" value="teste"/>
   <input type="text" name="fieldName"/>
   <button type="submit" value="Enviar"/>
</form>
</html>

--php search.

<?php

include_once '../class/Busca.class.php';

$filter = filter_input(INPUT_POST, 'form');
if (!is_null($filter)) {
    $form = $filter;
}

switch ($form) {
   case 'teste':
      echo Busca::getTeste();
      break;
}

?>

--Search.class.php

<?php

class Busca {
    public static function getTeste():string {
         return "teste";
    }
}

Well, that would be basic modularized communication between html and php. A medica that you add js to send forms without the need to refresh the entire page, for example, things get more interesting.

This is how I basically organize my projects:

  • view (php with html and forms)
  • php (control files between view and php classes)
  • class (php classes for accessing BD and more elaborate things)

I hope I’ve helped, any doubt I’m available!

  • Friend, I appreciate the help, I will restructure my project right now, I have 14 folders in it and do not follow a good standard...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.