当前位置: 首页>>代码示例>>PHP>>正文


PHP Object::__construct方法代码示例

本文整理汇总了PHP中yii\base\Object::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Object::__construct方法的具体用法?PHP Object::__construct怎么用?PHP Object::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在yii\base\Object的用法示例。


在下文中一共展示了Object::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * @param string|mixed[] $config the configuration of [[\romkaChev\yii2\swiper\Slide]]
  *                               You can create slide just from string
  *                               For example:
  *
  *                               ~~~
  *                                 $slide = new \romkaChev\yii2\swiper\Slide('slide content');
  *                               ~~~
  *
  *
  *                               Also you can create slide from array or strings and
  *                               they will be merged into one string
  *                               For example:
  *
  *                               ~~~
  *                                $slide = new \romkaChev\yii2\swiper\Slide([
  *                                    'content' => [
  *                                        '<h1>Title</h1>',
  *                                        '<h3>Subtitle</h3>',
  *                                        '<p>Main content</p>'
  *                                    ]
  *                                ]);
  *                               ~~~
  *
  * @see \romkaChev\yii2\swiper\Slide::$background
  * @see \romkaChev\yii2\swiper\Slide::$hash
  * @see \romkaChev\yii2\swiper\Slide::$content
  */
 public function __construct($config = [])
 {
     $config = is_string($config) ? [self::CONTENT => $config] : $config;
     $config[self::CONTENT] = ArrayHelper::getValue($config, self::CONTENT, null);
     $config[self::CONTENT] = is_array($config[self::CONTENT]) ? implode('', $config[self::CONTENT]) : $config[self::CONTENT];
     parent::__construct($config);
 }
开发者ID:romka-chev,项目名称:yii2-swiper,代码行数:35,代码来源:Slide.php

示例2: __construct

 /**
  * Costruisce una nuova istanza della classe e imposta le proprietà fondamentali.
  * @param type $id Id applicazione
  * @param type $basePath Cartella root dell'applicazione
  * @param type $filesSubfolder Sottocartella per i files di configurazione
  */
 public function __construct($id, $basePath, $filesSubfolder = null)
 {
     $this->_id = $id;
     $this->_basePath = $basePath;
     $this->_configFolder = dirname(__FILE__) . '/../../../config/' . ($filesSubfolder ? $filesSubfolder . '/' : '');
     parent::__construct();
 }
开发者ID:mauriziocingolani,项目名称:yii2-fmwk-php,代码行数:13,代码来源:Config.php

示例3: __construct

 /**
  * @param \phpDocumentor\Reflection\BaseReflector $reflector
  * @param Context $context
  * @param array $config
  */
 public function __construct($reflector = null, $context = null, $config = [])
 {
     parent::__construct($config);
     if ($reflector === null) {
         return;
     }
     // base properties
     $this->name = ltrim($reflector->getName(), '\\');
     $this->startLine = $reflector->getNode()->getAttribute('startLine');
     $this->endLine = $reflector->getNode()->getAttribute('endLine');
     $docblock = $reflector->getDocBlock();
     if ($docblock !== null) {
         $this->shortDescription = ucfirst($docblock->getShortDescription());
         if (empty($this->shortDescription) && !$this instanceof PropertyDoc && $context !== null && $docblock->getTagsByName('inheritdoc') === null) {
             $context->errors[] = ['line' => $this->startLine, 'file' => $this->sourceFile, 'message' => "No short description for " . substr(StringHelper::basename(get_class($this)), 0, -3) . " '{$this->name}'"];
         }
         $this->description = $docblock->getLongDescription()->getContents();
         $this->phpDocContext = $docblock->getContext();
         $this->tags = $docblock->getTags();
         foreach ($this->tags as $i => $tag) {
             if ($tag instanceof SinceTag) {
                 $this->since = $tag->getVersion();
                 unset($this->tags[$i]);
             } elseif ($tag instanceof DeprecatedTag) {
                 $this->deprecatedSince = $tag->getVersion();
                 $this->deprecatedReason = $tag->getDescription();
                 unset($this->tags[$i]);
             }
         }
     } elseif ($context !== null) {
         $context->errors[] = ['line' => $this->startLine, 'file' => $this->sourceFile, 'message' => "No docblock for element '{$this->name}'"];
     }
 }
开发者ID:136216444,项目名称:yii2-apidoc,代码行数:38,代码来源:BaseDoc.php

示例4: __construct

 public function __construct(\luya\web\Request $request, \luya\web\UrlManager $urlManager, array $config = [])
 {
     $this->request = $request;
     $this->urlManager = $urlManager;
     // parent object
     parent::__construct($config);
 }
开发者ID:rocksolid-tn,项目名称:luya,代码行数:7,代码来源:ModuleReflection.php

示例5: __construct

 /**
  * Fills property values
  * @param array $properties
  */
 public function __construct($properties)
 {
     foreach ($properties as $name => $value) {
         $this->hasProperty($name) && ($this->{$name} = $value);
     }
     parent::__construct();
 }
开发者ID:opus-online,项目名称:yii2-classifier,代码行数:11,代码来源:Entry.php

示例6: __construct

 /**
  *
  * @param array $config
  */
 public function __construct($config = [])
 {
     if (!empty($config['metadata']) && is_array($config['metadata'])) {
         $this->_metadata = $config['metadata'];
         unset($config['metadata']);
     }
     parent::__construct($config);
 }
开发者ID:fproject,项目名称:workflowii,代码行数:12,代码来源:AbstractWorkflowItem.php

示例7: __construct

 /**
  * @inheritdoc
  */
 public function __construct($config = [])
 {
     $source = ArrayHelper::remove($config, 'source');
     parent::__construct($config);
     if (!empty($source)) {
         $this->setSource($source);
     }
 }
开发者ID:cookyii,项目名称:module-media,代码行数:11,代码来源:AbstractResource.php

示例8: __construct

 /**
  * Конструктор
  * @param string $path
  * @param array $config
  * @throws \common\exceptions\IoException
  */
 public function __construct($path, $config = [])
 {
     if (!is_file($path)) {
         throw new IoException(Yii::t('core', 'File {file} does not exists.', ["{file}" => $path]));
     }
     $this->path = $path;
     parent::__construct($config);
 }
开发者ID:frostiks25,项目名称:rzwebsys7,代码行数:14,代码来源:File.php

示例9: __construct

 /**
  * @param string $name
  * @param string $alias
  * @param null|string $stamp
  * @param array $config
  */
 public function __construct($name, $alias, $stamp = null, $config = [])
 {
     $this->_name = $name;
     $this->_alias = $alias;
     $this->_stamp = $stamp;
     $this->_fileName = static::extractFileName($alias, $stamp);
     parent::__construct($config);
 }
开发者ID:zhuravljov,项目名称:yii2-logreader,代码行数:14,代码来源:Log.php

示例10: __construct

 /**
  * @inheritdoc
  *adding rule that saying: not assigning id user to the view  
  *use global var $idAdmin
  */
 public function __construct($id, $user = null, $config = array())
 {
     if ($id != Yii::$app->params['idAdmin']) {
         $this->id = $id;
         $this->user = $user;
     }
     parent::__construct($config);
 }
开发者ID:DiegoRodriguezTandil,项目名称:MoisesVille,代码行数:13,代码来源:Assignment.php

示例11: __construct

 /**
  * Constructor
  * @param \common\helper\DOMNode $node
  * @param array $config config array
  */
 public function __construct($config = [])
 {
     $this->reset();
     if (isset($config['DomNode'])) {
         $this->_root = $config['DomNode'];
         unset($config['DomNode']);
     }
     parent::__construct($config);
 }
开发者ID:tqsq2005,项目名称:digpage,代码行数:14,代码来源:SectionNode.php

示例12: __construct

 /**
  * @param string $callback
  * @param array $parameters
  * @param array $config
  */
 public function __construct($callback, array $parameters = [], $config = [])
 {
     $this->callback = $callback;
     $this->parameters = $parameters;
     Object::__construct($config);
     if (!is_string($this->callback) && !is_callable($this->callback)) {
         throw new InvalidParamException("Invalid scheduled callback event. Must be string or callable.");
     }
 }
开发者ID:BBrunekreeft,项目名称:yii2-scheduling,代码行数:14,代码来源:CallbackEvent.php

示例13: __construct

 public function __construct($config = [])
 {
     $config = array_merge($this->defaults, $config);
     $this->variant = $config['variant'];
     $this->fileName = $config['fileName'];
     $this->PHPWord = new \PHPWord();
     $this->calculation = new Calculation();
     parent::__construct();
 }
开发者ID:altairsoft,项目名称:building_mechanic,代码行数:9,代码来源:Generator.php

示例14: __construct

 public function __construct($config = [])
 {
     $config['config_file'] = \Yii::getAlias($config['config_file']);
     parent::__construct($config);
     if (!file_exists($this->config_file)) {
         $this->saveDefaultCfg();
     } else {
         $this->load($this->config_file);
     }
 }
开发者ID:yurii-github,项目名称:yii2-mylib,代码行数:10,代码来源:Configuration.php

示例15: __construct

 public function __construct($config)
 {
     parent::__construct($config);
     $this->tableNameRaw = Yii::$app->db->schema->getRawTableName($this->tableName);
     if (!$this->tableName) {
         throw new ErrorException("Table name not defined");
     }
     $this->afterInit();
     $this->generateFields();
 }
开发者ID:infinitydevphp,项目名称:yii2-table-builder,代码行数:10,代码来源:TableBuilder.php


注:本文中的yii\base\Object::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。