V
V
Vitaly Liber2015-04-07 15:42:42
Yii
Vitaly Liber, 2015-04-07 15:42:42

How to integrate Yii2 into third party systems?

Using the input script, I connected Yii2 to the old site in order to expand its functionality.

require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');

$yiiConfig = require(__DIR__ . '/../config/web.php');
new yii\web\Application($yiiConfig);

On Yii2, I created a model, view and controller for the form, added a widget for loading and cropping images. Directly at the address (/yii2/web/index.php) everything works fine.
How to add a form to the main page of the site so that the form located in (/yii2/views/site/index.php) is available (and works) at (/index.php) ?
Perhaps someone has experience integrating Yii2 into third-party systems.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Makarov, 2015-04-07
@SamDark

There are many options.
1. iframe.
2. Do not do new yii\web\Application($yiiConfig);, use Yii models and components in the code of the original system.
3. AJAX

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question