A simple PHP model-view-controller framework, built step-by-step as part of the "Write PHP like a pro: build an MVC framework from scratch" course on Udemy.
First of all, thank you for open sourcing this wonderful library. I have followed both of your Udemy tutorials.
After successful login, I am taking the User to the Home Page.
On my home page,
Users can enter some data in the input text field.
They click "Place Bet" button.
Data will be updated in the DB tables.
I want to stay in the same and I do not want to reload the page.
From the View page... how can I invoke a function which is written inside a controller. I tried to use
<a href="/test/test">Test/a>
and <form action="/test/test" method="post"> but browser is redirecting to new page. All I want to do is just update the data in the DB and stay at same page. I don't even want to reload the page.
I have created a controller
` *
PHP version 7.0
*/
class Test extends \Core\Controller
{
/**
Show the signup page
@return void
*/
public function testAction()
{
//updateDB
//code
}
}`
I am facing difficulties to achieve the above functionality. Maybe I have not understood the library.
I just replied to your question inside the Q&A section on the course, but yes, you need to use an Ajax request. You can send these using post, getting the data from the form, for example like this.
Hi,
First of all, thank you for open sourcing this wonderful library. I have followed both of your Udemy tutorials.
After successful login, I am taking the User to the Home Page. On my home page,
From the View page... how can I invoke a function which is written inside a controller. I tried to use
<a href="/test/test">Test/a>
and<form action="/test/test" method="post">
but browser is redirecting to new page. All I want to do is just update the data in the DB and stay at same page. I don't even want to reload the page.I have created a controller ` *
PHP version 7.0 */ class Test extends \Core\Controller {
/**
}`
I am facing difficulties to achieve the above functionality. Maybe I have not understood the library.