{ if (!$image instanceof self) { throw new InvalidArgumentException(sprintf('Imagick\Image can '. 'only paste() Imagick\Image instances, %s given', get_class($image) )); } if (!$this->getSize()->contains($image->getSize(), $start)) { throw new OutOfBoundsException( 'Cannot paste image of the given size at the specified '. 'position, as it moves outside of the current image\'s box' ); } try { $this->imagick->compositeImage( $image->imagick, \Imagick::COMPOSITE_DEFAULT,
if (!isset($start[0], $start[1])) { throw new InvalidParamException('$start must be an array of two elements.'); } $img = static::getImagine()->open(Yii::getAlias($filename)); $watermark = static::getImagine()->open(Yii::getAlias($watermarkFilename)); $img->paste($watermark, new Point($start[0], $start[1])); return $img; } /** * Draws a text string on an existing image.
$class = ['size' => 12 ]; if($this->id == $item_details->id) $class = ['size' => 12 , 'color' => '08f003']; $percent = round(pow($item_details->antutuT, 10)/(pow($max, 10)/100)); @Image::watermark($image_url, Yii::getAlias('@webroot/img/antutu_chart.png'), [65+$percent, $i])->save($image_url, ['quality' => 100]); @Image::text($image_url, $item_details->antutuT , Yii::getAlias('@webroot/arial.ttf'), [340+$percent, $i], $class)->save($image_url, ['quality' => 100]); @Image::watermark($image_url, Yii::getAlias('@webroot/img/antutu_chart_transperent.png'), [0, $i-5])->save($image_url, ['quality' => 100]); @Image::text($image_url, substr($item_details->full_name, 0, 20) , Yii::getAlias('@webroot/arial.ttf'), [10, $i], $class )->save($image_url, ['quality' => 100]);
*/ public function __get($name) { $getter = 'get' . $name; if (method_exists($this, $getter)) { // read property, e.g. getName() return $this->$getter(); } else { // behavior property $this->ensureBehaviors(); foreach ($this->_behaviors as $behavior) { if ($behavior->canGetProperty($name)) { return $behavior->$name;
} elseif ($this->hasAttribute($name)) { return null; } else { if (isset($this->_related[$name]) || array_key_exists($name, $this->_related)) { return $this->_related[$name]; } $value = parent::__get($name); if ($value instanceof ActiveQueryInterface) { return $this->_related[$name] = $value->findFor($name, $this); } else { return $value; } }
<div class="col-lg-7"> <?php if($model->antutuT){ echo('<img style="margin-left: auto; margin-right: auto;" src="'.$model->imageAntutuUrl.'" alt="'.Yii::t('app', 'AnTuTuAnTuTu Benchmark').' '.$model->full_name.'" title="'.Yii::t('app', 'AnTuTu Benchmark').' '.mb_strtolower(Yii::t('app', $model->category->name)).' '.$model->full_name.'">'); }else{ echo(Yii::t('app', 'Coming soon')); } ?> <br>
*/ public function renderPhpFile($_file_, $_params_ = []) { ob_start(); ob_implicit_flush(false); extract($_params_, EXTR_OVERWRITE); require($_file_); return ob_get_clean(); } /** * Renders dynamic content returned by the given PHP statements.
$this->renderers[$ext] = Yii::createObject($this->renderers[$ext]); } /* @var $renderer ViewRenderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $params, $output); } array_pop($this->_viewFiles); $this->context = $oldContext;
* @throws InvalidParamException if the view cannot be resolved or the view file does not exist. * @see renderFile() */ public function render($view, $params = [], $context = null) { $viewFile = $this->findViewFile($view, $context); return $this->renderFile($viewFile, $params, $context); } /** * Finds the view file based on the given view name. * @param string $view the view name or the path alias of the view file. Please refer to [[render()]] * on how to specify this parameter.
* These parameters will not be available in the layout. * @return string the rendering result. * @throws InvalidParamException if the view file or the layout file does not exist. */ public function render($view, $params = []) { $content = $this->getView()->render($view, $params, $this); return $this->renderContent($content); } /** * Renders a static string by applying a layout. * @param string $content the static string being rendered
return $this->render('antutunew', [ 'model' => $model, 'arr_bench' => $arr_bench, 'max' => $max, ]); }
$args = $this->controller->bindActionParams($this, $params); Yii::trace('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); Yii::$app->controller = $oldController; return $result; } else { $id = $this->getUniqueId(); throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
$params = $this->catchAll; unset($params[0]); } try { Yii::trace("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } else { $response = $this->getResponse(); if ($result !== null) { $response->data = $result;
try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
$config = yii\helpers\ArrayHelper::merge( require(__DIR__ . '/../../common/config/main.php'), require(__DIR__ . '/../config/main.php') ); $application = new yii\web\Application($config); $application->run();
$_GET = [ 'id' => '16307', 'seo' => 'ulefone-armor-6s', ]; $_SESSION = [ '__flash' => [], '__returnUrl' => '/phone/antutu/16307/ulefone-armor-6s', ];