We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7231
    • 4,205 Posts
    I am wondering if I can use ! to determine if there is a value in a class? I would use it in an if statement like this
    <?php if ($var1 == 'value' && $var2 > 'value'  && !$this->_resource['value'] ?>

    The verbose translation would be: if var equals value AND var2 is greater than value AND this->_resource is not set.

    What I want is to check to see if $this->_resource[’value’] has a value or has been set. I am new to classes in php so I have never seen this used like this before.
      [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

      Something is happening here, but you don&#39;t know what it is.
      Do you, Mr. Jones? - [bob dylan]
      • 19164
      • 1,215 Posts
      ! is a logical negation and means NOT. If $this->_resource[’value’] == TRUE than !$this->_resource[’value’] == FALSE.

      If you want to check that $this->_resource[’value’] is not set - use !isset($this->_resource[’value’])
        DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. | DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.

        Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.

        [PLUGIN] DirectResize - as Maxigallery but for single images :: Download :: [url=http://modxcms.com/forums/index.php/topic,21490]
        • 7231
        • 4,205 Posts
        If you want to check that $this->_resource[’value’] is not set - use !isset($this->_resource[’value’])
        Great. Thanks.

        So the final statement would look like:
        <?php if ($var1 == 'value' && $var2 > 'value'  && !isset($this->_resource['value'])) ?>
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don&#39;t know what it is.
          Do you, Mr. Jones? - [bob dylan]