Welcome Guest, Not a member yet? Register   Sign In
Cannot use isset to check for segment.. Why not?
#3

(02-17-2016, 05:53 PM)cupboy Wrote: Cannot do this:
if (isset($this->uri->segment(1))) //   Can't use method return value in write context in....

But this is OK:
if ($this->uri->segment(1))

Anyone know the reason? I don't know what the "write context" error means.

Here is some similar code in system library (although it has no parameter, maybe that's the difference):
if ( ! isset($this->lib_name))

What you could do is

PHP Code:
$uri_segment_1 $this->uri->segment(1);

if (isset(
$uri_segment_1)) {


There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
RE: Cannot use isset to check for segment.. Why not? - by wolfgang1983 - 02-17-2016, 06:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB