Как использовать еще, если в HTML?

0

Я использую joomla, и я хочу сделать это с помощью моего шаблона!

<html>
   <?php if ($this['config']->get('home')) : ?>
      <div class="home">
       Some content
      <div>
   <?php else : ?>
      <div class="page">
       Some other content
      <div>
   <?php else if ($this['config']->get('blog')) : ?>
      <div class="blog">
       Some other blog content
      <div>
   <?php endif; ?>
</html>

Моя проблема в том, что я не могу использовать несколько (else if) в этом коде.

скажем так:

<html>
   <?php if ($this['config']->get('home')) : ?>
      <div class="home">
       Some content
      <div>
   <?php else if ($this['config']->get('page')) : ?>
      <div class="page">
       Some other content
      <div>
   <?php else if ($this['config']->get('blog')) : ?>
      <div class="blog">
       Some other blog content
      <div>
   <?php endif; ?>
</html>

мой английский не такой впечатляющий, поэтому я надеюсь, что вы меня поймете

Теги:
joomla

1 ответ

2

Вам не нужно использовать другое, если в последнем

<html>
   <?php if ($this['config']->get('home')) : ?>
      <div class="home">
       Some content
      <div>
   <?php else if ($this['config']->get('page')) : ?>
      <div class="page">
       Some other content
      <div>
   <?php else  : ?>
      <div class="blog">
       Some other blog content
      <div>
   <?php endif; ?>
</html>
  • 0
    Спасибо, я проверю это :)
  • 0
    если это работает, пожалуйста, примите мой ответ @Strigo

Ещё вопросы

Сообщество Overcoder
Наверх
Меню