Page 1 of 1

reach to a function without refresh

Posted: Tue Dec 01, 2015 1:41 pm
by publicGenome
Hi There,

I'm working on an application (legacy code) which is wrapped in laravel 4.2
On a nav bar, upon click I'd like to reach the laravel controller. Things go fine, but until I refresh the page I won't reach to the function.

My code looks like:

Code: Select all

	if(isset( $_SESSION['currentfunc'])){		
		if(substr( $_SESSION['currentfunc'], 0,strlen('illumina')) === 'illumina'){
			echo App::make('Controllers\illumina\mainIllumina')->route($_SESSION['currentfunc']);
		}
	}
in the controller I've:

Code: Select all

	public function route($parameter){
		
		Log::info("yes we are here");
	}
How do I fix it?
From controller I'd like user to view xyz page, or do some processing.
Do I need to go for AJAX?

Thanks.

Re: reach to a function without refresh

Posted: Tue Dec 01, 2015 5:23 pm
by Christopher
If you want to reach to a function without refreshing the page, you need to use Ajax. The Ajax call can then return data to generate changes to the page, or return the actual HTML to replace part of the page.

Re: reach to a function without refresh

Posted: Wed Dec 09, 2015 9:21 am
by publicGenome
Hi Chris,
Thanks for your reply. I got it done. :)