当前位置: 首页 > news >正文

建设手机银行seo教程seo入门讲解

建设手机银行,seo教程seo入门讲解,wordpress 3.1.3,seo免费课程视频介绍 Laravel 框架的所有配置文件都保存在 config 目录中。每个选项都有说明#xff0c;你可随时查看这些文件并熟悉都有哪些配置选项可供你使用。 使用 您可以在应用程序的任何位置使用全局 config 辅助函数轻松访问配置值。 可以使用“点”语法访问配置值#xff0c;其中…介绍 Laravel 框架的所有配置文件都保存在 config 目录中。每个选项都有说明你可随时查看这些文件并熟悉都有哪些配置选项可供你使用。 使用 您可以在应用程序的任何位置使用全局 config 辅助函数轻松访问配置值。 可以使用“点”语法访问配置值其中包括您希望访问的文件名和选项。 也可以指定默认值如果配置选项不存在将返回 $value config(app.timezone);// 如果配置值不存在则检索默认值... $value config(app.timezone, Asia/Seoul);使用分析 我们可以先看一下助手函数 config if (! function_exists(config)) {/*** Get / set the specified configuration value.** If an array is passed as the key, we will assume you want to set an array of values.** param array|string|null $key* param mixed $default* return mixed*/function config($key null, $default null){if (is_null($key)) {return app(config);}if (is_array($key)) {return app(config)-set($key);}return app(config)-get($key, $default);} }分析 app(‘config’) 是注册到服务容器的实例,这里我们追踪到config 的实例是 Illuminate\Contracts\Config\RepositoryRepository 的 set get 方法代码如下 /*** Set a given configuration value.** param array|string $key* param mixed $value* return void*/public function set($key, $value null){$keys is_array($key) ? $key : [$key $value];foreach ($keys as $key $value) {Arr::set($this-items, $key, $value);}}/*** Get the specified configuration value.** param array|string $key* param mixed $default* return mixed*/public function get($key, $default null){if (is_array($key)) {return $this-getMany($key);}return Arr::get($this-items, $key, $default);} 这时我们就可以清晰的知道助手函数config($key null, $default null)的含义 如果$key 不传或者传null返回的是注册到服务容器中Repository实例如果$key 为数组那么修改Repository 的 items的值 其他情况 返回 Repository 的 items[$key] ?? $default 此时我们就可能有疑问 Repositiry 中 items 值是什么时候进行赋值的呢赋的值又是那些呢接下来我们一点点的分析 绑定服务容器 在laravel运行中并没有直接绑定 Repositiry 到容器中而是第一次构建config实例的时候进行了绑定app(‘config’) 或者 app()-make(‘config’) 时检测是否进行绑定如果没有的话进行绑定下面时make函数 /*** Resolve the given type from the container.** param string $abstract* param array $parameters* return mixed*/public function make($abstract, array $parameters []){$abstract $this-getAlias($abstract);if (! $this-bound($abstract) array_key_exists($abstract, $this-availableBindings) ! array_key_exists($this-availableBindings[$abstract], $this-ranServiceBinders)) {$this-{$method $this-availableBindings[$abstract]}();$this-ranServiceBinders[$method] true;}return parent::make($abstract, $parameters);}根据代码可知 $this-availableBindings[config] registerConfigBindingsregisterConfigBindings函数即为绑定到容器方法 /*** Register container bindings for the application.** return void*/protected function registerConfigBindings(){$this-singleton(config, function () {return new ConfigRepository;});}因此在调用make(‘config’) 时若没有绑定自动调用registerConfigBindings方法进行绑定 配置文件赋值 在bootstrap/app.php中进行对配置文件进行了赋值譬如 $app-configure(auth); $app-configure(permission); $app-configure(excel); $app-configure(database);configure函数为 /*** Load a configuration file into the application.** param string $name* return void*/public function configure($name){if (isset($this-loadedConfigurations[$name])) {return;}$this-loadedConfigurations[$name] true;$path $this-getConfigurationPath($name);if ($path) {$this-make(config)-set($name, require $path);}}这里的操作就是将conf/$name.conf 的内容写到 Repositiry 中 items 值中
http://www.w-s-a.com/news/285035/

相关文章:

  • 怎么取网页视频网站元素计算机专业论文网站开发
  • 上海网站建设备案号怎么恢复wordpress打开页面空白
  • 30个做设计的网站企业设计网站
  • 招生网站开发的背景创意 wordpress
  • 网站备案资料查询小型企业管理系统软件
  • 温州网站建设维护怎么做好网站开发、设计
  • 佛山 做网站公司有哪些网站排名忽然不见了
  • 广告网站建设最专业东莞大朗网站设计
  • 网站做流量的论坛贴吧分销商城系统源码
  • 新手建立网站的步骤网站建设费怎么入分录
  • 哪里建网站性价比高做网站赚取广告费
  • 邢台集团网站建设价格微信怎么做捐钱的网站
  • 做网站费用需要分摊吗装修公司一般多少钱一平方
  • 公司主页的网站格式wordpress自动推送给百度
  • 网站建设辶金手指排名十二wordpress 当数据库
  • 无锡手机网站建设服务苏州展厅设计企业
  • 无锡网站制作需要多少钱北京二次感染最新消息
  • 网站开发视频播放无画面杭州房产信息网官网
  • 网站开发 改进如何创建公众号平台
  • wordpress网站响应很慢只有asp网站代码可以重新编译吗
  • 哪个网站教做饭做的好wordpress热点文章
  • 可以做推广东西的网站重庆网站建设 重庆网站制作
  • 珠海网站建设培训学校wordpress去版权 合法
  • 建设食品商购网站学校网站设计实验报告
  • 建个网站多少钱沭阳奥体小区做网站的
  • 广州视频网站建站公司php网页设计作业代码
  • 成都公司网站设计如何制作网址最简单的方法
  • 温州 做网站福建住房城乡建设部网站
  • 网站自动化采集成都网站设计费用
  • 广东专业网站定制建设淘宝网站的人员组织结构