PHP code example of bscheshirwork / yii2-gui-acyclic-graphs
1. Go to this page and download the library: Download bscheshirwork/yii2-gui-acyclic-graphs library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bscheshirwork / yii2-gui-acyclic-graphs example snippets
/**
* @property MainModel[] $parents
* @property MainModel[] $childs
*/
class MainModel extends \yii\db\ActiveRecord
{
var $id;
}
/**
* @property MainModel $parent
* @property MainModel $child
*/
class RelationModel extends \yii\db\ActiveRecord
{
var $parentId;
var $childId;
}
// '/config/web.php' for Basic or '/backend/config/main' - Advanced Yii2 application.
'modules' => [
'gui' => [
'class' => 'bscheshirwork\gui\Module',
'as access' => [ // if you need to set access
'class' => 'yii\filters\AccessControl',
'rules' => [
[
'allow' => true,
'roles' => ['@'] // all auth users
],
],
],
'mainModel' => 'common\models\MainModel', // model, who have relations. (rectangles)
'mainModelFormView' => '@backend/views/main-model/_form-gui', //Active form for MainModel. See @vendor/bscheshirwork/yii2-gui-acyclic-graphs/src/views/default/_form
'relationModel' => 'common\models\RelationModel', // via model (arrows)
'arrowDirection' => bscheshirwork\gui\Module::PARENT_TO_CHILD, // direction of arrow representation
],
],
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.