Edijs87 Posted April 13, 2011 Report Share Posted April 13, 2011 interesee kaa uzstaadiit taa, lai lapa atveertos citas lapas, piemeeram, vidusdaljaa, kur saakas kaut kaads teksts vai cita informacija? Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted April 13, 2011 Report Share Posted April 13, 2011 Frame vai iframe Quote Link to comment Share on other sites More sharing options...
daGrevis Posted April 13, 2011 Report Share Posted April 13, 2011 #1 variants: var izveidot atsevišķus failus, kur vienādais saturs ("header's", navigācija, "footer's") ir dublēts. Slikts variants... #2 variants: izveidot failus header.php un footer.php, piemēram. Tajos atradīsies tas, kas būs kopīgs visām lapām. Tad tos iekļauj katrā lapā... <?php require 'header.php'; // Vai "*.html". ?> <p>Seika, pasaule!</p> <?php require 'footer.php'; ?> Quote Link to comment Share on other sites More sharing options...
Edijs87 Posted April 13, 2011 Author Report Share Posted April 13, 2011 paldies again daGrevis, centiishos :) Quote Link to comment Share on other sites More sharing options...
anonīms Posted April 13, 2011 Report Share Posted April 13, 2011 daGrevis, un ko darīt, ja grib mainīgu $title? Quote Link to comment Share on other sites More sharing options...
codez Posted April 13, 2011 Report Share Posted April 13, 2011 Skaties MVC un templeitu sistēmas virzienā: http://php.lv/f/topic/16623-ka-uzrakstit-vienkarsu-mvc-framework-u http://php.lv/f/topic/16923-ka-izveidot-vienkarsu-routing-framework-u/ Quote Link to comment Share on other sites More sharing options...
gta1151 Posted April 14, 2011 Report Share Posted April 14, 2011 daGrevis, un ko darīt, ja grib mainīgu $title? Funkcija <?php function head($title){ include("header.php"); } function footer(){ include("footer.php"); } ?> Ja gribi izvadīt <?php header("Sveika pasaule"); echo 'Sveika pasaule'; footer(); ?> Quote Link to comment Share on other sites More sharing options...
daGrevis Posted April 14, 2011 Report Share Posted April 14, 2011 @anonīms, pirmkārt, Es taisītu visu uz MVC arhitektūras, bet tas jau cits stāsts... Bet kur problēma "title'am"? "Global scope". $title = 'Mana lapa'; require 'header.php'; header.php <?php echo $title; ?> Un kaut kāds HTML... P.S. Nedaudz uzlabots (reāls "downgrade") @gta1151 variantam. Nav jēgas tur funkciju veidot. Quote Link to comment Share on other sites More sharing options...
anonīms Posted April 14, 2011 Report Share Posted April 14, 2011 jā, bet atkal man personīgi kaitina, ka iekšs katras lapas tagad būs tas include header.php/footer.php Quote Link to comment Share on other sites More sharing options...
codez Posted April 14, 2011 Report Share Posted April 14, 2011 inklūdot headerus un footerus ir "so 90's" Quote Link to comment Share on other sites More sharing options...
gta1151 Posted April 14, 2011 Report Share Posted April 14, 2011 @anonīms, pirmkārt, Es taisītu visu uz MVC arhitektūras, bet tas jau cits stāsts... Bet kur problēma "title'am"? "Global scope". $title = 'Mana lapa'; require 'header.php'; header.php <?php echo $title; ?> Un kaut kāds HTML... P.S. Nedaudz uzlabots (reāls "downgrade") @gta1151 variantam. Nav jēgas tur funkciju veidot. Tā arī var,katram sava gaume kodēšana. Quote Link to comment Share on other sites More sharing options...
anonīms Posted April 14, 2011 Report Share Posted April 14, 2011 nu man pašlaik projektam vienam ir $title = blabla; $keywords = blalba; // un parejie meta tagi, ja vajag function page() { } bet nu hz. Man liekas, ka tomēr ir arī spicāki varianti Quote Link to comment Share on other sites More sharing options...
daGrevis Posted April 14, 2011 Report Share Posted April 14, 2011 Es jau teicu, ka pats tā nedaru! Tā nemaz nevajadzētu darīt. MVC! Quote Link to comment Share on other sites More sharing options...
anonīms Posted April 14, 2011 Report Share Posted April 14, 2011 nu man tikai interesanti kā dari Tu :D nebļauj, ausis jau sāp Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.