chore: Аннотации к типам
This commit is contained in:
parent
530a3b931d
commit
730a608f9b
27 changed files with 491 additions and 134 deletions
|
|
@ -4,29 +4,42 @@
|
|||
* Класс сервиса = Упрощенный компонент
|
||||
*/
|
||||
namespace ctiso\Controller;
|
||||
use ctiso\Path,
|
||||
ctiso\Model\BaseMapper,
|
||||
ctiso\File,
|
||||
ctiso\Registry,
|
||||
ctiso\Database\PDOStatement;
|
||||
|
||||
use ctiso\Path;
|
||||
use ctiso\Model\BaseMapper;
|
||||
use ctiso\File;
|
||||
use ctiso\Registry;
|
||||
use ctiso\Database\PDOStatement;
|
||||
use ctiso\Database;
|
||||
|
||||
class Service
|
||||
{
|
||||
/** @var array */
|
||||
public $viewPath = [];
|
||||
/** @var array */
|
||||
public $webPath = [];
|
||||
/** @var Registry */
|
||||
public $config;
|
||||
public $template;
|
||||
public $templatePath;
|
||||
public $COMPONENTS_WEB;
|
||||
|
||||
/** @var Database */
|
||||
public $db;
|
||||
|
||||
/**
|
||||
* Возвращает путь к шаблонам
|
||||
* @param string $name Имя шаблона
|
||||
* @return string
|
||||
*/
|
||||
public function getTemplatePath($name)
|
||||
{
|
||||
return Path::join($this->viewPath[0], 'templates', 'modern', $name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Возвращает путь к шаблонам
|
||||
* @return string
|
||||
*/
|
||||
public function getTemplateWebPath()
|
||||
{
|
||||
return Path::join($this->webPath[0], strtolower(get_class($this)), 'templates', 'modern');
|
||||
|
|
@ -58,6 +71,7 @@ class Service
|
|||
* @param string $key
|
||||
* @param string $val
|
||||
* @param PDOStatement $res
|
||||
* @return array
|
||||
*/
|
||||
public function options($key, $val, $res) {
|
||||
$result = [];
|
||||
|
|
@ -67,6 +81,11 @@ class Service
|
|||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $list
|
||||
* @param bool $selected
|
||||
* @return array
|
||||
*/
|
||||
public function optionsPair($list, $selected = false) {
|
||||
$result = [];
|
||||
foreach ($list as $key => $value) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue