Mecha CMS

Mecha CMS blog and documentation.

Search Form

Basic search form.

<form action="<?php echo $site->is('pages') ? $url->clean : Path::D($url->clean); ?>" method="get">
    <input name="<?php echo $config->q; ?>" value="<?php echo HTTP::get($config->q); ?>" type="text">
    <button type="submit">Search</button>

The search functionality is a native feature of the page extension. By appending a ?q=foo+bar query string to the end of a URL, it will automatically search for pages that contains foo and bar in the file name. This feature does not have ability to search for text within the page file content due to the performance problem on every file-based CMS. This search functionality will also search only for files that are placed within the current directory. So, there is no such thing called recursive search.