# Autoloading

You never need to use XoopsLoad or manually load a class file to use XMF. All XMF classes load automatically whenever you refer to them.

For example, consider the familiar XoopsRequest class.

```php
XoopsLoad('xoopsrequest');
$cleanInput = XoopsRequest::getString('input', '');
```

XMF has a version of Request that is regularly synchronized with newer versions, and will be the definitive version starting with XOOPS 2.5.8. This is how the same code can look with XMF:

```php
$input = Xmf\Request::getString('input', '');
```

You can combine this with the tips under [namespaces](/xmf-cookbook/basic-ingredients/namespaces.md), and expand to a few more input fields for a look at a more typical use case:

```php
use Xmf\Request;

// ...

$input = Request::getString('input', '');
$id = Request::getInt('id', '');
$op = Request::getCmd('op', 'display');
```

Autoloading for the `Xmf` namespace is managed by a [PSR-4](http://www.php-fig.org/psr/psr-4/) autoloader. The same autoloader also manages autoload for several libraries that XMF depends on. This autoloader will be standard in future XOOPS versions.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xoops.gitbook.io/xmf-cookbook/basic-ingredients/autoloading.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
