Jump to content
Sign in to follow this  
ArtemPitov

[Решено] помогите с if

Recommended Posts

Доброго времени суток !

 

Хочу сделать вывод в меню ссылку с переходом на главную если страница отличается от главной, но не могу сообразить как составить условия. Все что придумал $home != $home, не так не подходит. Помогите с условиям, спасибо  

 

<?php if ($home != $home ) { ?>
<li><a href="<?php echo $home; ?>">Главная</a></li> 
<?php } ?>

Share this post


Link to post
Share on other sites

В контроллере common/home

Ну или $_request

Share this post


Link to post
Share on other sites

В контроллере common/home

Ну или $_request

Спасибо за ответ, но я немного не понял по поводу контроллера 

Share this post


Link to post
Share on other sites

В Ocstore  разве логотип не выводится с тем же условием?

Share this post


Link to post
Share on other sites

В Ocstore  разве логотип не выводится с тем же условием?

OC 2 выводиться лого так 

<?php if ($logo) { ?>
  <a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" "img-responsive" /></a>
                    
  <?php } else { ?>
    <h1><a href="<?php echo $home; ?>"><?php echo $name; ?></a></h1>
  <?php } ?>

Share this post


Link to post
Share on other sites


 <?php if ($home == $og_url) { ?>

  <img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" />

  <?php } else { ?>

  <a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a>

  <?php } ?>

Share this post


Link to post
Share on other sites
 <?php if ($home == $og_url) { ?>
  <img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" />
  <?php } else { ?>
  <a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a>
  <?php } ?>

В оп 2 нет переменной $og_url 

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Я об этом и писал))

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.