数据不是从表单发送的。 MODX革命

CMF MODX revolution

There is a template with a form

<form action="http://localhost/index.php?id=3" method="post">
        <input type="name" name="name">
                <input type="search" placeholder="Все товары" name="search_bar">
        <input type="submit" value="">
        <div style="clear: both;"></div>
</form>

which call a snippet which contains debugging line:

echo '|||||||||||| ', $_POST['search_bar'];

The problem. If I put a value into search bar - echo will not show anything. But if I save the template before I putt the value into the search bar and click submit button, then echo display right value from the search bar

Suppose the problem is in caching. But I cleaned it and it is cancelled everywhere (at least I think so, exploring administrator panel).

For Snippets that depend on user input (like a search query) you will want to call them uncached: [[!mySnippet]]

However if you want to gain a bit of performance you can wrap the Snippet call with Jason Coward's getCache, and by default it caches to a unique cache key based on the $_GET parameters. In other words, each search query would get its own cache object. This helps when there are repeat searches for the same string.