當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。