SlideShare uma empresa Scribd logo
1 de 7
Baixar para ler offline
‫‪ smarty‬وي ‪ php‬دا قوللىىىص دەرسلىني‬

   ‫بۇماقالە ‪ smarty‬وي ئىطلىتىپ ئۇسلۇبالروي قاوداق باضقۇرۇش توغرىسىدا‬

                                                              ‫توختېلىدۇ‬

 ‫‪ smarty‬ماتورى بولسا ئاجايىپ ياخطي بىر قوراه بولۇپ سىسوىڭ توربەت‬

                         ‫اليھىلەش ۋاقتىڭىسوي زور دەرىجىدە تىجەپ قالىدۇ‬



                                ‫نى مى ش قا بىس ‪ smarty‬وي قوللىىىمىس‬

  ‫ھەممىمىسگە مەلۇملۇقني ئەگەر بىس بىۋاستە ‪ php‬وي بىۋاستە ‪ html‬بىلەن‬

                                        ‫قولالوساق خاتالىق مىلىپ چىقىدۇ‬

    ‫‪ smarty‬وي قوللىىىطدا ‪ php‬بىلىص تەلەپ قىلىىمايدۇ،توربەت تەرەققي‬

    ‫قىلدۇرغۇچىالر ‪ smarty‬وي واھايتي ئاساوال ئىطلىتطىي بىلىپ مېتەلەيدۇ .‬

                                      ‫‪ smarty‬وي قەيەردىه چۈضۈرىمىس؟‬

‫تۆۋەودىني ئادرىسدىه ‪ smarty‬بولىقىىي چۈضۈرۈپ ‪ php‬بىلەن بىرلەضتۈرۈڭ‬

                                             ‫‪smarty.net/download‬‬

                                                        ‫قاچىالش ئۇسۇلي‬

 ‫‪ smarty‬بولىقىىي چۈضۈرگەودىه مىيىه ‪ php‬قاچىالوغان مۇودەرىجە ئىچىدىني‬

                                   ‫‪ wwroot‬وىڭ ئىچىگە بوالقىي يىطىڭ‬

                                 ‫‪ smarty‬دىني ئاساسلىق گىرامماتىنىالر‬

‫‪ ibs/Smarty.class.php‬ھۆججىتىىي ‪ include‬جۈملىسي ئارقىلىق چاقىرىپ‬

                                                              ‫ئەمىرىص‬

                        ‫‪b‬بىرداوە ئوبىينىت قۇرۇش ئۇسۇلي تۆۋەودىنىدەك‬


‫;‪$smarty = new Smarty‬‬
‫ ئۆزگەرگۈچي مىقدارالروي تەقسىملەش،ئۇسلي تۆۋەودىنىدەك‬c



$smarty->assign("var_name", "Smarty");

                                         ‫ئەمدى ئەمەلي مودالر باضالودى‬

                        ‫ وي قوضۇمىس‬css ‫ ۋە‬javascript ‫. ھۆججىتىگە‬tpl

} literal {

>" link rel="stylesheet" href="css/style.css" type="text/css <

> script<

{)( function display

document.write(“Welcome to smarty”);

}

</script>

{ /literal}



                        ‫ دىني قۇرۇولمىىي مووتروه قىلىص ئۇسۇلي‬Smarty

                                                       ‫ھالەت جۈملىسي‬

}) if (condition {

---- statements -----

} if /{



}) if (condition {

---- statements -----
} else{

---- statements -----

} if /{



}) if (condition {

---- statements -----

}) elseif (condition {

---- statements -----

} if /{

} if /{



‫دەۋرىيلەش ئۇسۇلي‬

} section name=i loop=$ptquestionary {

}] ptquestionary[i${

} section/{



   ‫ وي ئىطلتىپ ئەزاالر تىسىملىص جەرياوىىي ئۆتەيدىغان بىر مىچىل‬smarty

                                                ‫پىروگىرامم تۈزۈپ باقىلي‬



                                                                ‫ساودان‬

CREATE TABLE USERS (

id INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
fullname VARCHAR( 255 ) NOT NULL ,

user_name VARCHAR( 255 ) NOT NULL ,

password VARCHAR( 255 ) NOT NULL ,

created_on TIMESTAMP ON UPDATE CURRENT_TIMESTAMP

NOT NULL DEFAULT CURRENT_TIMESTAMP

);




                                 ‫ وي مۇوداق تەڭطەيمىس‬config.php

<?php
$dbHost = “localhost”;
$dbUser = ”username”;

$dbPassword=”password”;
$dbName=”database”;
$con =
mysql_connect($dbHost,$dbUser,$dbPassword);
$sel = mysql_select_db($dbName,$con) or
mysql_error();
?>
                                      ‫مۇوداق تەڭطىلىدۇ‬index.php

<?php
include(“libs/Smarty.class.php”);
include(“config.php”);
$smarty = new Smarty;
$smarty->debugging = true;
$smarty->caching = true;
$smarty->cache_lifetime = 120;
$smarty->assign("title", "exlatkuqini tizimlax");
$smarty->display('index.tpl');
?>
                                 ‫مۇوداق تەڭطىلىدۇ‬register.php

<?php

include("config.php");

if(isset($_POST))

{

$query = "INSERT INTO

USERS(fullname,user_name,password) VALUES ('

".mysql_escape_string($_POST['fullname'])."',

'".mysql_escape_string($_POST['user_name'])."','".md5($_PO

ST['password'])."')";

$result = mysql_query($query);

if($result)

{

echo "<script>window.location='index.php?msg=successfully

inserted ';</script>";
}

}

?>

         ‫ مۇوداق تەڭطىلىدۇ‬headr.tpl ‫ئۇسلۇب ھۆججىتىي ئۆزئىچىگە ئالغان‬

> HTML<

> HEAD<

> TITLE>{$title}</TITLE <

} literal {

>" style type="text/css <

{ body

; font-family:Arial, Helvetica, sans-serif

; font-size:12px

; color:#333333

}

> style/<

} literal /{

> HEAD/<

> BODY<

                                          ‫مۇوداق تەڭطىلىدۇ‬index.tpl

}} include file="header.tpl" title={$title {

form method=”post” action=”register.php”>                <

<div>
<div>Name : <input type=”text” name=”fullname”

id=”fullname”></div>

<div>User Name : <input type=”text” name=”user_name”

id=”user_name”></div>

<div>Password : <input type=”text” name=”password”

id=”password”></div>

<div><input type=”submit” name=”submit”

value=”submit” ></div>

</div>

</form>

{include file="footer.tpl"}



                                        ‫ مۇوداق تەڭطىلىدۇ‬footer.tpl

> BODY/<

> HTML/<



smarty ‫يۇقارقي جەرياوالروي ئەمەلي تەجرىبىدىه ئۆتنۈزۈپ سىىاپ باقسىڭىس‬

                    ! ‫وىڭ ھەقىقەتەومۇ قواليلىق ئىنەولىنىىي ھىس قىلىسىس‬

                                                   tormahiri ‫تۈزگۈچي‬

                                                      ‫توربەت ئادرىسي‬

                 http://tormahiri.weebyl.com

Mais conteúdo relacionado

Destaque

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Destaque (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Smarty ni kollinix

  • 1. ‫‪ smarty‬وي ‪ php‬دا قوللىىىص دەرسلىني‬ ‫بۇماقالە ‪ smarty‬وي ئىطلىتىپ ئۇسلۇبالروي قاوداق باضقۇرۇش توغرىسىدا‬ ‫توختېلىدۇ‬ ‫‪ smarty‬ماتورى بولسا ئاجايىپ ياخطي بىر قوراه بولۇپ سىسوىڭ توربەت‬ ‫اليھىلەش ۋاقتىڭىسوي زور دەرىجىدە تىجەپ قالىدۇ‬ ‫نى مى ش قا بىس ‪ smarty‬وي قوللىىىمىس‬ ‫ھەممىمىسگە مەلۇملۇقني ئەگەر بىس بىۋاستە ‪ php‬وي بىۋاستە ‪ html‬بىلەن‬ ‫قولالوساق خاتالىق مىلىپ چىقىدۇ‬ ‫‪ smarty‬وي قوللىىىطدا ‪ php‬بىلىص تەلەپ قىلىىمايدۇ،توربەت تەرەققي‬ ‫قىلدۇرغۇچىالر ‪ smarty‬وي واھايتي ئاساوال ئىطلىتطىي بىلىپ مېتەلەيدۇ .‬ ‫‪ smarty‬وي قەيەردىه چۈضۈرىمىس؟‬ ‫تۆۋەودىني ئادرىسدىه ‪ smarty‬بولىقىىي چۈضۈرۈپ ‪ php‬بىلەن بىرلەضتۈرۈڭ‬ ‫‪smarty.net/download‬‬ ‫قاچىالش ئۇسۇلي‬ ‫‪ smarty‬بولىقىىي چۈضۈرگەودىه مىيىه ‪ php‬قاچىالوغان مۇودەرىجە ئىچىدىني‬ ‫‪ wwroot‬وىڭ ئىچىگە بوالقىي يىطىڭ‬ ‫‪ smarty‬دىني ئاساسلىق گىرامماتىنىالر‬ ‫‪ ibs/Smarty.class.php‬ھۆججىتىىي ‪ include‬جۈملىسي ئارقىلىق چاقىرىپ‬ ‫ئەمىرىص‬ ‫‪b‬بىرداوە ئوبىينىت قۇرۇش ئۇسۇلي تۆۋەودىنىدەك‬ ‫;‪$smarty = new Smarty‬‬
  • 2. ‫ ئۆزگەرگۈچي مىقدارالروي تەقسىملەش،ئۇسلي تۆۋەودىنىدەك‬c $smarty->assign("var_name", "Smarty"); ‫ئەمدى ئەمەلي مودالر باضالودى‬ ‫ وي قوضۇمىس‬css ‫ ۋە‬javascript ‫. ھۆججىتىگە‬tpl } literal { >" link rel="stylesheet" href="css/style.css" type="text/css < > script< {)( function display document.write(“Welcome to smarty”); } </script> { /literal} ‫ دىني قۇرۇولمىىي مووتروه قىلىص ئۇسۇلي‬Smarty ‫ھالەت جۈملىسي‬ }) if (condition { ---- statements ----- } if /{ }) if (condition { ---- statements -----
  • 3. } else{ ---- statements ----- } if /{ }) if (condition { ---- statements ----- }) elseif (condition { ---- statements ----- } if /{ } if /{ ‫دەۋرىيلەش ئۇسۇلي‬ } section name=i loop=$ptquestionary { }] ptquestionary[i${ } section/{ ‫ وي ئىطلتىپ ئەزاالر تىسىملىص جەرياوىىي ئۆتەيدىغان بىر مىچىل‬smarty ‫پىروگىرامم تۈزۈپ باقىلي‬ ‫ساودان‬ CREATE TABLE USERS ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  • 4. fullname VARCHAR( 255 ) NOT NULL , user_name VARCHAR( 255 ) NOT NULL , password VARCHAR( 255 ) NOT NULL , created_on TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); ‫ وي مۇوداق تەڭطەيمىس‬config.php <?php $dbHost = “localhost”; $dbUser = ”username”; $dbPassword=”password”; $dbName=”database”; $con = mysql_connect($dbHost,$dbUser,$dbPassword); $sel = mysql_select_db($dbName,$con) or mysql_error(); ?> ‫مۇوداق تەڭطىلىدۇ‬index.php <?php include(“libs/Smarty.class.php”); include(“config.php”);
  • 5. $smarty = new Smarty; $smarty->debugging = true; $smarty->caching = true; $smarty->cache_lifetime = 120; $smarty->assign("title", "exlatkuqini tizimlax"); $smarty->display('index.tpl'); ?> ‫مۇوداق تەڭطىلىدۇ‬register.php <?php include("config.php"); if(isset($_POST)) { $query = "INSERT INTO USERS(fullname,user_name,password) VALUES (' ".mysql_escape_string($_POST['fullname'])."', '".mysql_escape_string($_POST['user_name'])."','".md5($_PO ST['password'])."')"; $result = mysql_query($query); if($result) { echo "<script>window.location='index.php?msg=successfully inserted ';</script>";
  • 6. } } ?> ‫ مۇوداق تەڭطىلىدۇ‬headr.tpl ‫ئۇسلۇب ھۆججىتىي ئۆزئىچىگە ئالغان‬ > HTML< > HEAD< > TITLE>{$title}</TITLE < } literal { >" style type="text/css < { body ; font-family:Arial, Helvetica, sans-serif ; font-size:12px ; color:#333333 } > style/< } literal /{ > HEAD/< > BODY< ‫مۇوداق تەڭطىلىدۇ‬index.tpl }} include file="header.tpl" title={$title { form method=”post” action=”register.php”> < <div>
  • 7. <div>Name : <input type=”text” name=”fullname” id=”fullname”></div> <div>User Name : <input type=”text” name=”user_name” id=”user_name”></div> <div>Password : <input type=”text” name=”password” id=”password”></div> <div><input type=”submit” name=”submit” value=”submit” ></div> </div> </form> {include file="footer.tpl"} ‫ مۇوداق تەڭطىلىدۇ‬footer.tpl > BODY/< > HTML/< smarty ‫يۇقارقي جەرياوالروي ئەمەلي تەجرىبىدىه ئۆتنۈزۈپ سىىاپ باقسىڭىس‬ ! ‫وىڭ ھەقىقەتەومۇ قواليلىق ئىنەولىنىىي ھىس قىلىسىس‬ tormahiri ‫تۈزگۈچي‬ ‫توربەت ئادرىسي‬ http://tormahiri.weebyl.com