vree Posted November 8, 2007 Share Posted November 8, 2007 <?php $menu = & JMenu::getInstance(); if ($menu->getActive() != $menu->getDefault()) : ?> <?php if($this->countModules('top')) : ?> <jdoc:include type="modules" name="top" style="xhtml" /> <?php endif; ?> <?php endif; ?> Link to comment https://forums.phpfreaks.com/topic/76523-how-to-combine-if-statements/ Share on other sites More sharing options...
SilveR316 Posted November 8, 2007 Share Posted November 8, 2007 You can add additional conditions to your IF statement by using && (AND) and || (IF) between them. The code you have could be written as: <?php $menu = & JMenu::getInstance(); if ($menu->getActive() != $menu->getDefault() && $this->countModules('top')) : ?> <jdoc:include type="modules" name="top" style="xhtml" /> <?php endif; ?> Link to comment https://forums.phpfreaks.com/topic/76523-how-to-combine-if-statements/#findComment-387570 Share on other sites More sharing options...
vree Posted November 8, 2007 Author Share Posted November 8, 2007 Thank you will try Link to comment https://forums.phpfreaks.com/topic/76523-how-to-combine-if-statements/#findComment-387573 Share on other sites More sharing options...
revraz Posted November 8, 2007 Share Posted November 8, 2007 I think you mean OR on your second (IF) You can add additional conditions to your IF statement by using && (AND) and || (IF) between them. Link to comment https://forums.phpfreaks.com/topic/76523-how-to-combine-if-statements/#findComment-387580 Share on other sites More sharing options...
rameshfaj Posted November 8, 2007 Share Posted November 8, 2007 Use any if statements including && symbols in between them if u want all to be true to go through the if statement of use || if want to enter if either of the condition to be true to enter inside the if part. Link to comment https://forums.phpfreaks.com/topic/76523-how-to-combine-if-statements/#findComment-387701 Share on other sites More sharing options...
SilveR316 Posted November 8, 2007 Share Posted November 8, 2007 I think you mean OR on your second (IF) You can add additional conditions to your IF statement by using && (AND) and || (IF) between them. Oops, you are correct. I don't think I was fully awake at the time of writing it. Link to comment https://forums.phpfreaks.com/topic/76523-how-to-combine-if-statements/#findComment-387703 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.