国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Table of Contents
Zend Framework教程之Bootstrap類用法概述,zendbootstrap
您可能感興趣的文章:
Home php教程 php手冊 Zend Framework教程之Bootstrap類用法概述,zendbootstrap

Zend Framework教程之Bootstrap類用法概述,zendbootstrap

Jun 13, 2016 am 08:44 AM
bootstrap framework zend

Zend Framework教程之Bootstrap類用法概述,zendbootstrap

本文實(shí)例講述了Zend Framework中Bootstrap類用法。分享給大家供大家參考,具體如下:

Zend_Application_Bootstrap_Bootstrapper

Zend_Application_Bootstrap_Bootstrapper是所有引導(dǎo)類必須實(shí)現(xiàn)的基本接口?;竟δ苁怯糜谂渲?,注冊資源,引導(dǎo)(無論是單個資源或整個應(yīng)用程序),并運(yùn)行應(yīng)用程序。

接口方法:

Zend_Application_Bootstrap_Bootstrapper Interface

Method Return Value Parameters Description
__construct(
$application
)
Void
  • $application:?必填的。?

    接受一個Zend_Application

    或一個Zend_Application_Bootstrap_Bootstrapper對象作為唯一的參數(shù)。

構(gòu)造方法。接受一個參數(shù),參數(shù)要求是一個Zend_Application對象,或另一個引導(dǎo)對象。

setOptions(
array $options)
Zend_Application_Bootstrap_Bootstrapper
  • $options:?必填. 配置選項(xiàng)數(shù)組

通常情況下, 選項(xiàng)都可以匹配映射到對應(yīng)的setter;否則,選項(xiàng)僅僅會被存儲,便于以后查找

getApplication() Zend_Application?|Zend_Application_Bootstrap_Bootstrapper N/A

獲取application實(shí)例

getEnvironment() String N/A

獲取environment

getClassResources() Array N/A

獲取可以可用的資源

bootstrap($resource = null) Mixed
  • $resource:?可選.

如果?$resource為空,注冊所有資源.如果為字符串注冊指定的資源;如果是數(shù)組, 只注冊指定的資源.

run() Void N/A

執(zhí)行引導(dǎo).


Zend_Application_Bootstrap_ResourceBootstrapper

Zend_Application_Bootstrap_ResourceBootstrapper是一個接口,用于引導(dǎo)類加載注冊外部資源 。 也就是說,一個或多個資源不會直接在類中定義,而是通過插件形式引入。它應(yīng)該與Zend_Application_Bootstrap_Bootstrapper結(jié)合使用; Zend_Application_Bootstrap_BootstrapAbstract實(shí)現(xiàn)了這個功能。

接口方法:

Zend_Application_Bootstrap_ResourceBootstrapper Interface

Method Return Value Parameters Description
registerPluginResource($resource, $options = null) Zend_Application_Bootstrap_ResourceBootstrapper
  • $resource:?必填,要求是資源名稱。

    或者Zend_Application_Resource_Resource對象

  • $options:?可選.?數(shù)組或Zend_Config對象,傳遞要注冊的資源的實(shí)例。

用于注冊資源類,通過可選選項(xiàng)傳遞資源

unregisterPluginResource($resource) Zend_Application_Bootstrap_ResourceBootstrapper
  • $resource:?必填的。注銷注冊資源的名稱

刪除插件資源

hasPluginResource($resource) Boolean
  • $resource:?必填. 資源名稱.


getPluginResource($resource) Zend_Application_Resource_Resource
  • $resource:?必填. 資源名稱


getPluginResourceNames() Array N/A


setPluginLoader(Zend_Loader_PluginLoader_Interface $loader) Zend_Application_Bootstrap_ResourceBootstrapper
  • $loader:?必填.?


getPluginLoader() Zend_Loader_PluginLoader_Interface N/A



Zend_Application_Bootstrap_BootstrapAbstract

Zend_Application_Bootstrap_BootstrapAbstract是一個抽象類,它提供了一個通用的引導(dǎo)基本功能。它實(shí)現(xiàn)了Zend_Application_Bootstrap_Bootstrapper和Zend_Application_Bootstrap_ResourceBootstrapper。

Zend_Application_Bootstrap_BootstrapAbstract Methods

Method Return Value Parameters Description
__construct($application) Void
  • $application:?必填.?

Accepts either a?Zend_Application?or a?Zend_Application_Bootstrap_Bootstrapper?object as the sole argument.

setOptions(array $options) Zend_Application_Bootstrap_Bootstrapper
  • $options:?必填. 選項(xiàng)數(shù)組

所有選項(xiàng)都可以映射到選項(xiàng)指定的setter??,

否則,該選項(xiàng)將只是被存儲供以后查找

例如,如果在擴(kuò)展類中定義一個setFoo() 方法,可以通過foo選項(xiàng)傳遞值


也可用于兩個額外的,特殊的選項(xiàng)。
?pluginPaths用于指定資源插件路徑前綴,它應(yīng)該是一個前綴為文件系統(tǒng)路徑的類的關(guān)聯(lián)數(shù)組。
resources用于指定資源插件,并應(yīng)包括插件資源實(shí)例的配置選項(xiàng)。

getOptions() Array N/A

?

hasOption($key) Boolean
  • $key:?必填. ?.

?

getOption($key) Mixed
  • $key:?必填.?

不存在返回?NULL??

setApplication(Zend_Application | Zend_Application_Bootstrap_Bootstrapper $application) Zend_Application_Bootstrap_BootstrapAbstract
  • $application:?必填.

?

getApplication() Zend_Application?|Zend_Application_Bootstrap_Bootstrapper N/A

?

getEnvironment() String N/A

?

getClassResources() Array N/A

?

getContainer() Object N/A

獲取存儲資源的容器。如果沒有容器,可以通過Zend_Registry注冊,然后返回一個Zend_Registry實(shí)例。

setContainer($container) Zend_Application_Bootstrap_BootstrapAbstract
  • $container,必填. 存放資源對象的容器對象


hasResource($name) Boolean
  • $name,?必填. 資源名稱

?

getResource($name) Mixed
  • $name,?必填. 資源名稱

?

bootstrap($resource = null) Mixed
  • $resource:?可選.

如果?$resource為空,注冊所有資源.如果為字符串注冊指定的資源;如果是數(shù)組, 只注冊指定的資源.

run() Void N/A


__call($method, $args) Mixed
  • $method:?必填. 方法名.

  • $args:?必填. 方法參數(shù)數(shù)組.

為了方便可以用'bootstrap()'代替 bootstrap() 引導(dǎo)注冊資源。


Zend_Application_Bootstrap_Bootstrap

Zend_Application_Bootstrap_Bootstrap是Zend_Application_Bootstrap_BootstrapAbstract具體實(shí)現(xiàn)。它的主要功能是,注冊資源,然后運(yùn)行 run() 方法。

在大多數(shù)情況下,你可以根據(jù)自己的引導(dǎo)需求繼承這個類或直接使用這個類,并來注冊資源插件。

啟用 Application 自動加載功能

此外,該引導(dǎo)的實(shí)現(xiàn)提供了自動加載指定“命名空間”或指定資源類的前綴的功能

本質(zhì)上,它實(shí)例化一個Zend_Application_Module_Autoloader的對象,參數(shù)為命名空間和引導(dǎo)類的目錄。可以開啟這個功能,通過 “appnamespace”配置選項(xiàng)設(shè)置命名空間。

As an INI example:

appnamespace = "Application"

Or in XML:

<appnamespace>Application</appnamespace>

默認(rèn)情況下,Zend_Tool提供“Application”命名空間。

或者,可以在bootstrap類中通過$_appNamespace屬性指定命名空間。

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
   protected $_appNamespace = 'Application';
}

更多關(guān)于zend相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《Zend FrameWork框架入門教程》、《php優(yōu)秀開發(fā)框架總結(jié)》、《Yii框架入門及常用技巧總結(jié)》、《ThinkPHP入門教程》、《php面向?qū)ο蟪绦蛟O(shè)計入門教程》、《php+mysql數(shù)據(jù)庫操作入門教程》及《php常見數(shù)據(jù)庫操作技巧匯總》

希望本文所述對大家PHP程序設(shè)計有所幫助。

您可能感興趣的文章:

  • Zend Framework自定義Helper類相關(guān)注意事項(xiàng)總結(jié)
  • Zend Framework教程之資源(Resources)用法實(shí)例詳解
  • Zend Framework教程之Application和Bootstrap用法詳解
  • Zend Framework教程之配置文件application.ini解析
  • Zend Framework教程之Loader以及PluginLoader用法詳解
  • Zend Framework教程之Autoloading用法詳解
  • Zend Framework教程之Resource Autoloading用法實(shí)例
  • Zend Framework教程之MVC框架的Controller用法分析
  • Zend Framework教程之路由功能Zend_Controller_Router詳解
  • Zend Framework教程之Zend_Controller_Plugin插件用法詳解
  • Zend Framework教程之響應(yīng)對象的封裝Zend_Controller_Response實(shí)例詳解
  • Zend Framework教程之動作的基類Zend_Controller_Action詳解
  • Zend Framework教程之前端控制器Zend_Controller_Front用法詳解
  • Zend Framework教程之Application用法實(shí)例詳解
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

PHP Tutorial
1500
276
How to use bootstrap in vue How to use bootstrap in vue Apr 07, 2025 pm 11:33 PM

Using Bootstrap in Vue.js is divided into five steps: Install Bootstrap. Import Bootstrap in main.js. Use the Bootstrap component directly in the template. Optional: Custom style. Optional: Use plug-ins.

How to write split lines on bootstrap How to write split lines on bootstrap Apr 07, 2025 pm 03:12 PM

There are two ways to create a Bootstrap split line: using the tag, which creates a horizontal split line. Use the CSS border property to create custom style split lines.

How to verify bootstrap date How to verify bootstrap date Apr 07, 2025 pm 03:06 PM

To verify dates in Bootstrap, follow these steps: Introduce the required scripts and styles; initialize the date selector component; set the data-bv-date attribute to enable verification; configure verification rules (such as date formats, error messages, etc.); integrate the Bootstrap verification framework and automatically verify date input when form is submitted.

How to get the bootstrap search bar How to get the bootstrap search bar Apr 07, 2025 pm 03:33 PM

How to use Bootstrap to get the value of the search bar: Determines the ID or name of the search bar. Use JavaScript to get DOM elements. Gets the value of the element. Perform the required actions.

How to view the date of bootstrap How to view the date of bootstrap Apr 07, 2025 pm 03:03 PM

Answer: You can use the date picker component of Bootstrap to view dates in the page. Steps: Introduce the Bootstrap framework. Create a date selector input box in HTML. Bootstrap will automatically add styles to the selector. Use JavaScript to get the selected date.

How to set up the framework for bootstrap How to set up the framework for bootstrap Apr 07, 2025 pm 03:27 PM

To set up the Bootstrap framework, you need to follow these steps: 1. Reference the Bootstrap file via CDN; 2. Download and host the file on your own server; 3. Include the Bootstrap file in HTML; 4. Compile Sass/Less as needed; 5. Import a custom file (optional). Once setup is complete, you can use Bootstrap's grid systems, components, and styles to create responsive websites and applications.

10 latest tools for web developers 10 latest tools for web developers May 07, 2025 pm 04:48 PM

Web development design is a promising career field. However, this industry also faces many challenges. As more businesses and brands turn to the online marketplace, web developers have the opportunity to demonstrate their skills and succeed in their careers. However, as demand for web development continues to grow, the number of developers is also increasing, resulting in increasingly fierce competition. But it’s exciting that if you have the talent and will, you can always find new ways to create unique designs and ideas. As a web developer, you may need to keep looking for new tools and resources. These new tools and resources not only make your job more convenient, but also improve the quality of your work, thus helping you win more business and customers. The trends of web development are constantly changing.

How to use bootstrap button How to use bootstrap button Apr 07, 2025 pm 03:09 PM

How to use the Bootstrap button? Introduce Bootstrap CSS to create button elements and add Bootstrap button class to add button text

See all articles