Pogledajte određenu poruku
Staro 22. 09. 2014.   #7
Bojsi
član
Certified
 
Datum učlanjenja: 24.01.2007
Poruke: 92
Hvala: 1
784 "Hvala" u 15 poruka
Bojsi is on a distinguished roadBojsi is on a distinguished roadBojsi is on a distinguished roadBojsi is on a distinguished roadBojsi is on a distinguished roadBojsi is on a distinguished roadBojsi is on a distinguished road
Default

Potrebna mi je jos jedna pomoc ako moze, problem se nadovezuje:

Pravim neki mini template sistem (za sopstvene potrebe) gde imam tagove u stilu:

Kd:
<php:ime_kontrole>...</php:ime_kontrole>
Kada se procita ovo ime_kontrole, ja izrenderujem tu kontrolu i onda dalje obradjujem njene child kontrole.

Unutar tagova za kontrolu, mogu se nalaziti i tagovi za svojstva (property).

Ceo primer:

Kd:
<property name="title">Ovo je pravi naslov</property>
<php:button>
    <property name="title">Ovo je pogresan naslov</property>
    <property name="styleClass">test</property>
</php:button>
Kao sto vidite, imam jednu ugnjezdenu kontrolu (button) i ona opet ima svoje propertije.

I koristim sledeci (PHP) kod da obradim propertije:

PHP kd:
$patterns[] = "|\<property name=\"(.*?)\"\>(.*?)\</property\>|e";        
$replaces[] = "\$this->setProperty($1, \"$2\");";        

$value preg_replace($patterns$replaces$value); 
Medjutim, ovde opet nastaje problem jer ce mi obrada "pokupiti" i propertije unutar button kontrole, sto je nepozeljno. Dakle, zelim da parser ne "zalazi" u <php:ime_kontrole> tagove (bilo kog nivoa).

Verovatno treba da iskljucim grupu koju koristim za "citanje" tagova za kontrole:

Kd:
"|\<php:(.*?)\>(.*?)\</php:\\1\>|e";
ali ne znam gde to da postavim?

Hvala jos jednom.
Bojsi je offline   Odgovorite uz citat
116 članova zahvaljuje Bojsi za poruku:
aaleragail, acheaplv, acheapnew, aczapiewskshain, aennimancarm, aeprocaccnath, aionscalzconc, alatchawsteve, allen4jim, anorthfacemens, ardgraafwilfo, areraodel, aringascarl, aschoonovemaked, brdvenablerayfo, cbuynecklaces, cellocchiwino, clgroschmurie, cstorecanada, cteciuccihenr, dmcgeadytegan, dorflesnersalva, dtepfundtvicen, eabuechersophi, eaksrobetiffany, eangeruth, ebuyaccessories, ecoervergabr, econeclar, edressesgreen, eduplerjerr, eeblinetyron, ejerseynfl, elionemilo, ellpollettmaxwe, enpaynetruma, eoulterjord, ershauerbric, eskuhlemarco, fhrentfrokhad, fnarufsabri, garkingtarah, giohoergeroctav, hneprchalvale, ichristianheels, idvddisney, ihybhatiatimot, inejennieroxan, inorrixdarr, ioltmeierlynd, ionpanfilprest, ipluvoisestep, irdfinninwinfo, istrahinarnu, istriblingmoshe, jsenajelia, kdubykmajor, ksaajokuthere, ktrackeisid, lclachlandust, ldoduchschreyna, lemosellerobbi, lerolees, linmonclerblack, lrbeatleyflet, lvaubelyoung, meistmaikl, menicomeodett, meymeri, mjanemiles, msematt, nilvanodust, nincenorah, nkemaneddi, nnaellanknatha, nohlingjeni, norbinshan, nsveentreva, nurdinmitc, oanomar, obertoerro, okristoffflor, olmilhoanhers, orangnowshaun, ottleroehugo, pcheapface, prdpala, rdemarckris, redmonstonwarne, renmorebufo, rggierijaco, rlamryan, rlmaherrusse, rransbrowerne, rruppenthatanne, rrymerjaci, rslerkimp, rtbonadonanorbe, ruhnerrenek, sairdiscount, sceeashcons, shelmsdarr, sholesarie, skocsismoshe, srdbaisesanfo, syerssand, tarnetcalv, tatttobi, tewittgran, vienvert, wacheweloy, waskiewichowa, wholesalephones, wholesaleprices, yntyno, yrleyange