So, for several weeks now I have been playing with my own PHP MVC Framework, exclusively for training. I have the basics, and I think I know what is happening, and so on. But I still could not understand the following.
Say I have a music database, and I have a “music controller”, a “music model” and, obviously, a “musical look”. What I want to do is, of course, the ability to insert a new artist and / or a new track, I would also like to be able to edit them, etc. My url is as follows:
example.com/controller/mainfunction
In my "music controller" I have a method as follows:
public function addTrack()
{
if (isset($_POST["submit_add_track"]))
{
}
}
, " " , . ..
. ? ? :
example.com/music/add/artist
example.com/music/add/track
-, , " ", , ? :
example.com/insert/artist
example.com/insert/track
, , , , .
, , , , "insert", " ", "insert track" ? , . , , .
, , ( ) . !
Edit:
, , . , . addArtist, , , - , . , . , ? , . ? - ?
example.com/music/insertArtist
, "insertArtist", "addArtist" , , . , - , . , "addArtist" "addArtist" , , "if submit then add artist". , , ?
public function addArtist()
{
}
public function editArtist($artistID)
{
}
public function deleteArtist($artistID)
{
}
public function addTrack()
{
}
public function editTrack($trackID)
{
}
public function deleteTrack($trackID)
{
}