reach to a function without refresh

Discussion for various published PHP frameworks, including Zend Framework, CodeIgniter, Kohana, CakePHP, Yii, Symfony, and others.

Moderator: General Moderators

Post Reply
publicGenome
Forum Contributor
Posts: 110
Joined: Thu Apr 16, 2015 7:55 am

reach to a function without refresh

Post 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.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: reach to a function without refresh

Post 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.
(#10850)
publicGenome
Forum Contributor
Posts: 110
Joined: Thu Apr 16, 2015 7:55 am

Re: reach to a function without refresh

Post by publicGenome »

Hi Chris,
Thanks for your reply. I got it done. :)
Post Reply