Welcome Guest, Not a member yet? Register   Sign In
Stop controller at this point, run other method
#1
Lightbulb 

In index of my Main.php controller I have something like this:

PHP Code:
$check $this->Logier->check_address($url);

if( 
$check === )
{
$this->show_page($url);
}
elseif( 
$check === )
{
$this->show_post($url);
}
else
{
show_404();
}

Can't I do something like...

$check = $this->Logier->check_address($url);

[size=small][font=Monaco, Consolas, Courier, monospace]if( $check === 1 )[/font][/size]
[size=small][font=Monaco, Consolas, Courier, monospace]{
[/font][/size][size=small]$this->show_page($url);
break();[/size]
[size=small][font=Monaco, Consolas, Courier, monospace]}[/font][/size]
[size=small][font=Monaco, Consolas, Courier, monospace]if( $check === 2 )[/font][/size]
[size=small][font=Monaco, Consolas, Courier, monospace]{[/font][/size]
[size=small][font=Monaco, Consolas, Courier, monospace]$this->show_post($url);
[/font][/size]break();
[size=small][font=Monaco, Consolas, Courier, monospace]}[/font][/size]
show_404();

I mean, to break at this point I want in just executing this actual method.
So it executes show_post, then output and so on.

Let'
s assume $check === 1
It executes then show_page
($urlmethod.
And 
nothing else in this index method. (So it doesn't check next if and doens't execute last command show_404();) 
Reply


Messages In This Thread
Stop controller at this point, run other method - by krystian2160 - 06-13-2017, 05:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB