rootfile_get_contents

file_get_contents  时间:2021-05-19  阅读:()
HTML_TreeMenuDocumentationIntroductionHTML_TreeMenuisasetofPHPclassestoenabletheeasycreationofHTMLbasedtreemenus.
ItcurrentlyhastheabilitytocreatebothDHTML,staticandlistboxmenus.
AllhavetheprerequisiteofJavascript,howevertheJavscriptcodecouldbeusedmanually,withoutthePHPclasses.
AuthorsHTML_TreeMenuwaswrittenbyRichardHeyesandHaraldRadi.
Contributions/patcheshavealsobeenreceivedandincorporatedfromvariouspeople.
FeaturesEasytolearnOObasedAPIDHTML(traditional)orlistbox()outputstylesMultiplemenusperpageCrossbrowserDOMcompatibleDHTMLOptionalbranchstatuspersistenceusingcookiesOptionalstaticmodewithoutDHTML(stillrequiresJavascriptsupport)Pernodeiconwithalternate"expanded"iconPernodeCSSclassspecificationPernodelinktargetsPernodeJavascripteventspecificationwithcustomonExpand,onCollapseandonToggleeventsAbilitytospecifyfrommenucreationifanodeisexpandedbydefault,andifitshouldbemadetobevisible(ieitsparentsareexpanded)StructureOverviewTherearefiveclassesintotal:HTML_TreeMenuThe"toplevel"treeclass.
HTML_TreeNodeThenodeclass.
HTML_TreeMenu_PresentationAnabstractbaseclassforthenexttwoclasses.
HTML_TreeMenu_DHTMLProducesaDHTMLstylemenu.
HTML_TreeMenu_ListboxProducesalistboxmenu.
TheHTML_TreeNodeclassisusedtocreatethestructurewhichisaddedtoaninstanceoftheHTML_TreeMenuclass.
Thisisinturnpassedtoaninstanceofeitherofthepresentationclasses(DHTMLorListbox).
Thesetwo"presentation"classeshaveaprintMenu()methodwhichcanbecalledtoprinttheresultingmenu.
ExampleSeetheexample.
phpfileforthecode.
Thiscodemakesasimplemenuwithtworootnodes,eachwithfivenestednodes.
ThecodegoesaboutcreatingtheinitialHTML_TreeMenuobject,andthencreatesthenodestobeadded.
Thenodesarethenaddedtothemenuobject,whichitselfisthenpassedtoaninstanceoftheHTML_TreeMenu_DHTMLobject(throughtheconstructor)andalsoanHTML_TreeMenu_Listboxobject.
ThenfollowssomeHTMLinwhichtheprintMenu()methodofeachpresentationobjectiscalledtoshowthemenus.
NotetheuseofreferenceswhenassigningthereturnofaddItem().
Failuretoassignbyreferencewillcauseproblems.
APIReferenceHTML_TreeMenuMethods&addItem(object&$node)ThismethodisusedtoaddaHTML_TreeNodetothetree.
IttakesaHTML_TreeNodeasitssoleargumentandreturnsareferencetothenodeinsidetheTreeMenuobject.
createFromStructure(array$params)Thismethodisanextremelyusefuloneifyoualreadyhaveatreestructuredefinedusingoneofthesupportedtreeclasses.
Ittakessaidtreestructureandreturnsatreemenubaseduponit.
Thistakestheworkoutoftraversingyourtreeandcreatingthestructureyourself.
ThesupportedtreestructuresareRichardHeyes'Treeclass(http://www.
phpguru.
org/tree.
html)andWolframKriesings'TreeclassavailablethroughPEARhttp://pear.
php.
net/Tree.
The$paramsargumentshouldbeanassociativearraywhichcanconsistofthefollowing:structureThetreestructuretypeThetype.
Defaultsto'heyes'.
Canalsobe'kriesing'.
nodeOptionsDefaultHTML_TreeNodeoptionswhichareusedwhilstbuildingthemenu.
InthecaseofmyownTreeclass,thesewillbemergedwiththetagdata.
ThereturnvalueistheHTML_TreeMenuobject.
createFromXML(mixed$xml)ThismethodwillcreateanHTML_TreeMenuobjectfromthesupplied$xmlargument.
ThisargumentcaneitherbeastringcontainingtheXML,oraPEAR::XML_Treeobject.
Iftheargumentisastring,themethodwillattempttorequire()theXML_TreeclassusingstandardPEARtechniques(ie:require_once('XML/Tree.
php')),andthencreateanXML_Treeobjectbasedonthestring.
ThemethodwillthenconverttheXML_TreeobjecttoaTreeclassusingmyownTreeclass(availablehere:http://phpguru.
org/tree.
html)sothisfile(Tree.
php)MUSTbeinclude()edorrequire()edbeforecallingthismethod.
IftheTreeclasscannotbefound,thismethodwilldie().
Onceconverted,themethodwillthenusethecreateFromStructure()methoddescribedabovetocreateanHTML_TreeMenuobjectandreturnit.
ForfurtherinformationonusingthismethodandtheXMLschemaseethecasestudybelow.
HTML_TreeNodeMethodsConstructor([array$options[,array$events]])Theconstructorhandlessettingupthenodeobjectbasedontheoptionssupplied.
The$optionsargumentshouldbeanassociativearraywhichcanconsistofthefollowing:textTitleofthenode,defaultstoblank.
linkHREFofthelink,defaultstoblank.
iconFilenameoftheicon.
Shouldbeintheimagesdirectoryassuppliedtothepresentationobject.
expandedIconFilenameoftheicontobeusedwhenthenodeisexpanded.
classCSSclassforthisnode,defaultstoblank.
expandedDefaultexpandedstatusofthisnode.
Defaultstofalse,andhasnoeffectonnondynamicpresentations.
linkTargetTargetforthelink.
DefaultstolinkTargetofthepresentationclass.
isDynamicIfthisnodeisdynamicornot.
Defaultstotrue.
ensureVisibleIftrue,thisnodewillbemadevisibleregardlessoftheexpandedsettingsandclientsidepersistence.
Defaultstofalse.
ThesecondargumentisanassociativearrayofJavascripteventsandassociatedhandlercode.
Thiscanalsoincludethreecustomevents:onexpand,oncollapse,andontoggle,whichshouldbeselfexplanatory.
Thisargumentcouldalsobesuppliedastheeventskeyinthefirstargument.
setOption(string$option,mixed$value)Usethismethodtosetanyoftheoptionsafterthenodehasbeencreated.
Theoptionnamesarethesameasthoseintheconstructor,andtakesimilarvalues.
&addItem(object&$node)ThisissimilarineveryrespecttotheaddItem()methodoftheHTML_TreeMenuclassandisusedtoaddchildnodes.
HTML_TreeMenu_DHTMLMethodsConstructor(&$structure[,array$options[,$isDynamic]])Thissetsupthepresentationobjectwiththegivenstructureandoptions.
ThestructureshouldbeanHTML_TreeMenuobject.
Theoptionsargumentshouldbeanassociativearray,andcanconsistofthefollowing:imagesThefoldertolookinforimages.
Defaultsto"images".
linkTargetTargetforanylinks.
Canbesethereinsteadofforeverynode.
Defaultsto"_self".
defaultClassDefaultCSSclasstouse.
Defaultstoblank.
usePersistenceWhethertouseclientsidepersistenceornot(withcookies).
Defaultstotrue.
noTopLevelImagesWhethertoskipthedisplayofthefirstlevelofbranchimagesiftherearemultiplerootnodes.
Defaultstofalse.
Thethridargument$isDynamiccanbeusedtospecifyWhethertheentiretreeisdynamicornot.
Defaultstotrue.
printMenu([$options])ThisisamethodinheritedfromtheabstractHTML_TreeMenu_Presentationclassandisusedtoprintthemenu.
Theoptionalargument$optionsshouldbeanassociativearraywhichcanconsistofthesameoptionsasthe$optionsargumentoftheconstructor.
HTML_TreeMenu_ListboxMethodsConstructor(&$structure[,array$options])Thissetsupthepresentationobjectwiththegivenstructureandoptions.
ThestructureshouldbeanHTML_TreeMenuobject.
Theoptionsargumentshouldbeanassociativearray,andcanconsistofthefollowing:promoTextThetextthatappearsatthetopofthelistbox.
Defaultsto"Select…"indentCharThecharacterusedtoindentthenodes.
Defaultsto" ".
indentNumHowmanyindentCharstouseperindentationlevel.
linkTargetTargetforanylinks.
Canbesethereinsteadofforeverynode.
Defaultsto"_self".
submitTextTextforthesubmitbutton.
Defaultsto"Go".
printMenu([$options])ThisisamethodinheritedfromtheabstractHTML_TreeMenu_Presentationclassandisusedtoprintthemenu.
Theoptionalargument$optionsshouldbeanassociativearraywhichcanconsistofthesameoptionsasthe$optionsargumentoftheconstructor.
Casestudy:CreatingatreemenuusingXMLTheHTML_TreeMenu::createFromXML()methodisanextremelyusefuloneifyouhaveatreemenutomaintainandwishtodosoinsimplerfashionthanupdatingPHPcodeeverytimeachangeisneed.
TheXMLcanbekeptinafileandreadintocreatethemenu,withlittlemorethanafewlinesofPHPcodenecessary.
Pros:VeryeasytomaintainLittlecodingrequiredbyyouNolossofcontroloverpresentationbywayofXMLtagattributesCons:SlowerAsaresultof:Increasedamountofincludedcode(Treeclass,XML_Treeclass,XML_Tree_Nodeclass,XML_Parserclass)XMLparsingthedecreasedspeedissignificantenoughtowarrantcachingoftheresultingHTML_TreeMenuobject,eitherinausers'sessionorperhapsafilebasedcache.
(PEARhasacoupleofcandidates–Cache&Cache_Lite).
IfyoudocachethetreeMenu,thenit'sentirelyconcievablethatitmayendupbeingfasterthanbuildingitinPHPeverytime,sothespeeddrawbackbecomesanon-issue.
TheXMLschemayoushoulduseconsistsoftwotags,and.
Thetagistherootelementandthereshouldonlyeverbeoneofthese.
Thetagdefinesanodeinthetreeandcanbenestedasmuchasyouwant.
ThetagcantakeasattributesanyoftheoptionswhichcanbepassedtotheHTML_TreeNodeconstructor(eg.
text,link,iconetc).
SomeexampleXML:Asyoucanseeit'sperfectlyOKtousetheXMLshortcutinsteadofifanodehasnochildnodes.
ThisXMLwillcreateatreeMenuwithfiverootnodes,withthefourthhavingfourchildnodes.
ThecodeyouwouldneedtousetocreatetheHTML_TreeMenuobjectisasfollows:You'rethenfreetousethe$treeMenustructurewitheitherofthepresentationclassesasnormal.
LicenseThepackageisdistributedundertheBSDlicense.
Wishlistfulfilmentisalwaysappreciatedofcourse:RichardHeyeshttp://phpguru.
org/wishlistHaraldRadihttp://www.
amazon.
com/.
.
.

香港云服务器最便宜价格是多少钱一个月、一年?

香港云服务器最便宜价格是多少钱一个月/一年?无论香港云服务器推出什么类型的配置和活动,价格都会一直吸引我们,那么就来说说香港最便宜的云服务器类型和香港最低的云服务器价格吧。香港云服务器最便宜最低价的价格是多少?香港云服务器只是服务器中最受欢迎的产品。香港云服务器有多种配置类型,如1核1G、2核2G、2核4G、8到16核32G等。这些配置可以满足大多数用户的需求,无论是电商站、视频还是游戏、小说等。...

云雀云(larkyun)低至368元/月,广州移动1Gbps带宽VDS(带100G防御),常州联通1Gbps带宽VDS

云雀云(larkyun)当前主要运作国内线路的机器,最大提供1Gbps服务器,有云服务器(VDS)、也有独立服务器,对接国内、国外的效果都是相当靠谱的。此外,还有台湾hinet线路的动态云服务器和静态云服务器。当前,larkyun对广州移动二期正在搞优惠促销!官方网站:https://larkyun.top付款方式:支付宝、微信、USDT广移二期开售8折折扣码:56NZVE0YZN (试用于常州联...

hostio荷兰10Gbps带宽,10Gbps带宽,€5/月,最低配2G内存+2核+5T流量

成立于2006年的荷兰Access2.IT Group B.V.(可查:VAT: NL853006404B01,CoC: 58365400) 一直运作着主机周边的业务,当前正在对荷兰的高性能AMD平台的VPS进行5折优惠,所有VPS直接砍一半。自有AS208258,vps母鸡配置为Supermicro 1024US-TRT 1U,2*AMD Epyc 7452(64核128线程),16条32G D...

file_get_contents为你推荐
供应商ios6设置xp补丁安装前必读Singlesb支持ipadeacceleratoraccess violation问题的解决办法!css3圆角在HTML里如何实现圆角矩形?ipad如何上网ipad如何允许app使用网络win10445端口win的22端口和23端口作用分别是什么 ?itunes备份itunes 里面的资料如何备份?
便宜vps 5折 国外主机 便宜建站 天猫双十一抢红包 商家促销 500m空间 浙江独立 福建天翼加速 坐公交投2700元 40g硬盘 数字域名 最好的免费空间 老左来了 秒杀汇 傲盾官网 33456 爱奇艺会员免费试用 服务器硬件防火墙 香港亚马逊 更多