Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ajax parameter for ajax call #504

Merged
merged 23 commits into from Jul 9, 2020
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/content/1.7/modules/concepts/controllers/front-controllers.md
Expand Up @@ -166,6 +166,17 @@ secured by redirecting it to HTTPS.
public $ssl = true;
```

### Ajax request

When you call controller via ajax, you nedd to add ajax parameter in teh url.

```php
Context::getContext()->link->getModuleLink('cheque', 'validation', array('idPayment' => 1337, 'ajax'=>true);
```

* Without URL rewriting: `http://<shop_domain>/index.php?idPayment=1337&fc=module&module=cheque&controller=validation&id_lang=1&ajax=true`
* With URL rewriting: `http://<shop_domain>/en/module/cheque/validation?idPayment=1337&ajax=true`

luigimassa marked this conversation as resolved.
Show resolved Hide resolved
## Addendum: Execution order of the controller’s functions

* **__construct()**: Sets all the controller’s member variables.
Expand Down