modules
This commit is contained in:
parent
56b42000c0
commit
da78311a5c
|
@ -1,14 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace dominion\cron;
|
||||
|
||||
/**
|
||||
* This is just an example.
|
||||
*/
|
||||
class AutoloadExample extends \yii\base\Widget
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
return "Hello!";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace dominion\cron;
|
||||
|
||||
/**
|
||||
* cron module definition class
|
||||
*/
|
||||
class Module extends \yii\base\Module
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $controllerNamespace = 'dominion\cron\controllers';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
|
||||
// custom initialization code goes here
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace dominion\cron\controllers;
|
||||
|
||||
use yii\web\Controller;
|
||||
|
||||
/**
|
||||
* Default controller for the `cron` module
|
||||
*/
|
||||
class DefaultController extends Controller
|
||||
{
|
||||
/**
|
||||
* Renders the index view for the module
|
||||
* @return string
|
||||
*/
|
||||
public function actionIndex()
|
||||
{
|
||||
return $this->render('index');
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
<?php
|
||||
return [
|
||||
|
||||
];
|
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
|
||||
namespace dominion\cron\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "mole_task".
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $parentId
|
||||
* @property string $dateAdd
|
||||
* @property string $dateStart
|
||||
* @property string $dateEnd
|
||||
* @property string $module
|
||||
* @property string $controller
|
||||
* @property string $type
|
||||
* @property string $name
|
||||
* @property string $params
|
||||
* @property int $isReady
|
||||
* @property int $completed
|
||||
* @property int $priority
|
||||
* @property int $childsTotalCount
|
||||
* @property int $childsCompleted
|
||||
* @property string $status
|
||||
* @property string $project
|
||||
*/
|
||||
class MoleTask extends \yii\db\ActiveRecord
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'mole_task';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['parentId', 'isReady', 'childsTotalCount', 'childsCompleted', 'status'], 'required'],
|
||||
[['parentId', 'isReady', 'completed', 'priority', 'childsTotalCount', 'childsCompleted'], 'integer'],
|
||||
[['dateAdd', 'dateStart', 'dateEnd'], 'safe'],
|
||||
[['params'], 'string'],
|
||||
[['module', 'controller', 'type', 'name', 'status'], 'string', 'max' => 255],
|
||||
[['project'], 'string', 'max' => 50],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id' => Yii::t('dominion\cron\app', 'ID'),
|
||||
'parentId' => Yii::t('dominion\cron\app', 'Parent ID'),
|
||||
'dateAdd' => Yii::t('dominion\cron\app', 'Date Add'),
|
||||
'dateStart' => Yii::t('dominion\cron\app', 'Date Start'),
|
||||
'dateEnd' => Yii::t('dominion\cron\app', 'Date End'),
|
||||
'module' => Yii::t('dominion\cron\app', 'Module'),
|
||||
'controller' => Yii::t('dominion\cron\app', 'Controller'),
|
||||
'type' => Yii::t('dominion\cron\app', 'Type'),
|
||||
'name' => Yii::t('dominion\cron\app', 'Name'),
|
||||
'params' => Yii::t('dominion\cron\app', 'Params'),
|
||||
'isReady' => Yii::t('dominion\cron\app', 'Is Ready'),
|
||||
'completed' => Yii::t('dominion\cron\app', 'Completed'),
|
||||
'priority' => Yii::t('dominion\cron\app', 'Priority'),
|
||||
'childsTotalCount' => Yii::t('dominion\cron\app', 'Childs Total Count'),
|
||||
'childsCompleted' => Yii::t('dominion\cron\app', 'Childs Completed'),
|
||||
'status' => Yii::t('dominion\cron\app', 'Status'),
|
||||
'project' => Yii::t('dominion\cron\app', 'Project'),
|
||||
];
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
<div class="cron-default-index">
|
||||
<h1><?= $this->context->action->uniqueId ?></h1>
|
||||
<p>
|
||||
This is the view content for action "<?= $this->context->action->id ?>".
|
||||
The action belongs to the controller "<?= get_class($this->context) ?>"
|
||||
in the "<?= $this->context->module->id ?>" module.
|
||||
</p>
|
||||
<p>
|
||||
You may customize this page by editing the following file:<br>
|
||||
<code><?= __FILE__ ?></code>
|
||||
</p>
|
||||
</div>
|
Loading…
Reference in New Issue