limingxinleo/x-phalcon-helper

Phalcon Helper Functions

1.0.2 2018-03-03 00:39 UTC

This package is auto-updated.

Last update: 2024-10-17 19:18:34 UTC


README

Phalcon helper

Build Status

获取依赖注入服务

<?php
use Phalcon\Config;
use Phalcon\Di\FactoryDefault;

$di = new FactoryDefault();
$di->setShared('config', function () {
    return new Config([
        'version' => '0.0.1',
        'application' => [
            'logDir' => __DIR__ . '/../logs/',
        ],
    ]);
});

$config = di('config');

获取系统环境变量

<?php

$name = env('name','limx');