Пример #1
0
 /**
  * Generate a placeholder using the query string parameters
  * @return resource
  */
 public function makePlaceholderFromURL()
 {
     $oURLResolver = new UrlResolver();
     return $this->makePlaceHolder($oURLResolver->getWidthValue(), $oURLResolver->getHeightValue(), $oURLResolver->getText(), $oURLResolver->getBackgroundColor(), $oURLResolver->getForegroundColor());
 }
Пример #2
0
<?php

/**
 * The FactoryDefault Dependency Injector automatically register the right services providing a full stack framework
 */
$di = new Phalcon\DI\FactoryDefault();
$di->set('config', $config);
/**
 * The URL component is used to generate all kind of urls in the application
 */
$di->set('url', function () use($config) {
    $url = new UrlResolver();
    $url->setBaseUri($config->application->baseUri);
    return $url;
}, true);
$di->set('view', function () {
    $view = new Phalcon\Mvc\View();
    $view->disable();
    return $view;
}, true);
// $di->setShared('config', $config);
/**
 * add routing capabilities
 */
$di->set('router', function () use($config) {
    require $config->application->appDir . 'config/routes.php';
    return $router;
});
\Phalcon\Mvc\Model::setup(array('notNullValidations' => false));
// $di->set("response", new \Phalcon\Http\Response);
// $di->set("request", new \Phalcon\Http\Request);