Smarty configuration and tutorial

Source: Internet
Author: User
Tags constant definition smarty template

Download smarty:

  • Smarty 2.6.18 source March 7th, 2007
  • Smarty 2.6.17 source March 5th, 2007
  • Smarty 2.6.16 source dec 1st, 2006
  • Smarty 2.6.15 source Nov 30th, 2006

    PHP designers who are new to the template engine will find it difficult to hear about smarty. In fact, I don't dare to touch it. However, when analyzing the xoops program architecture, it began to find that smarty is actually not difficult. As long as you practice the basic functions of smarty, It is enough in general applications. Of course, the foundation can be well laid, so there is no need to worry about the next advanced application.
      
    The main purpose of this article is not to thoroughly explore the use of smarty, which has been fully written in official instructions. I will only write down some of my usage experiences here, so that I can get some inspiration from my friends who want to know about smarty but cannot get into it. Because the content of this article is not very in-depth, friends who will use smarty may feel simple.
      
    At present, this article has been revised for the third time, and I want to add more materials. However, due to the relationship between time, I have not thoroughly studied many advanced smarty skills, so I dare not take it out, however, I believe this article should be able to satisfy most beginners who want to learn smarty. Of course, if there are any mistakes in this article, please let us know that I will correct them in the next revision.
      
      Smarty Introduction
      
    What is a template engine?

      
    I don't know when to start. Some people started to feel unsatisfied with the embedded server script in HTML. However, both Microsoft's ASP and open source PHP are webpage servo-side languages embedded with server scripts. So some people think that it would be better to separate the application logic (or commercial application logic) from the WEB presentation logic (layout?
      
    In fact, this problem has existed for a long time. When interactive web pages become popular, both ASP and PHP users are both program developers and visual designers. However, these users are usually either program or artist, and if they want to take both of them into account, they have to die a lot of brain cells...
      
    So the template engine came into being! The purpose of the template engine is to achieve the logic separation function mentioned above. It enables program developers to focus on data control or function fulfillment, while visual designers can focus on web page layout to make webpages look more professional! Therefore, the template engine is suitable for the company's website development team, so that everyone can exert their expertise!
      
    For the template engine that I have been familiar with, it is roughly divided into two forms based on the data presentation method: the template engine that needs to be matched with the program processing and the template engine that is completely determined by the template itself.
      
    In the template engine that needs to be matched with the program processing, the program developer must be responsible for the variable presentation logic, that is, he must process the variable content before outputting it to the template, in order to do assign work. In other words, program developers should write more programs to determine the style of variables. The template engine, which is completely determined by the template itself, allows the variables to be directly added to the template, so that the visual designer can decide how to present the variables when designing the template. Therefore, it may have another set of template program syntax (such as smarty), to facilitate control of the presentation of variables. However, visual designers also need to learn how to use the template language.
      
    The operating principle of the template engine is as follows:

  •  


    Generally, the template engine (such as phplib) obtains the template to be parsed when creating the template object, and then sets the variable into it, and parses the template through the parse () method, finally, output the webpage.
       
    For the smarty user, the program does not need to do any parse action, and these Smarty will automatically help us. In addition, if the template has not changed, Smarty will automatically skip the compilation action and directly execute the compiled webpage to save Compilation Time.
      
      Some concepts of using smarty
      
    In the general template engine, we often see the concept of a region. The so-called block may grow like this:
    <! -- Start: block name -->
    Region content
    <! -- End: block name -->
      
    Most of these blocks use if or for and while in PHP programs to control their display status. Although the template looks much more concise, you only need to change the display mode of different templates, the PHP program is bound to be changed again!
      
    In smarty, all variables are dominated, and all presentation logic is controlled by the template. Because smarty has its own template language, the template syntax of smarty (if, foreach, Section) and variable content are used to present whether the block is to be displayed or repeated. In this way, it seems that the template has become a little complicated, but the advantage is that as long as the planning is proper, PHP programs do not have to change the line.
      
    From the above description, we can know that to use smarty, We need to master the principle of clearly separating the application logic from the webpage presentation logic. That is to say, PHP programs do not have too many html codes. In the program, you only need to make sure that the variables are in the template, so that the template determines how to present these variables (or even not ).
      
      Smarty Basics
      
    Install smarty

      
    First, we first determine the place where the program is placed.
      
    In Windows, it may be like this: "D:/appserv/web/demo /」.
      
    In Linux, it may be like this: "/home/jaceju/public_html /」.
      
    Download the latest smarty kit: http://smarty.php.net from the smarty official website.
      
    After unlocking smarty 2.6.0, you will see many files, including a libs folder. In libs, there should be 3 class. php labels + 1 Debug. TPL + 1 plugin folder + 1 core folder. Then copy the libs file to the main folder of your program and rename it to class. That's it? That's right! This method is relatively simple and suitable for users without their own hosts.
      
    Why are some complicated installation methods described in the smarty official manual? Basically, the installation is based on the official method. It can be installed only once on the host, and then provided to all designers under the host for direct reference when developing different programs, rather than installing too many smarty copies. The method provided by the author is suitable for developers who want to bring the program over and migrate it, so that there is no need to worry about whether the host has installed smarty.
      
      Program Folder settings
      
    Take the installation of appserv in Windows as an example. The main folder of the program is "D:/appserv/web/demo /」. After installing smarty, we will create a folder like this under the main Folder:
       
    Under Linux, remember to change the templates_c permission to 777. In Windows, the read-only mode is canceled.
      
      The first small program written with smarty
      
    First, set the path of the smarty file. Name the following file as main. php and place it in the main Folder:
      
    Main. php:
    <? PHP
    Include "Class/smarty. Class. php ";
    Define ('_ site_root', 'd:/appserv/web/demo'); // No diagonal lines at last
    $ TPL = new smarty ();
    $ TPL-> template_dir = _ site_root. "/templates /";
    $ TPL-> compile_dir = _ site_root. "/templates_c /";
    $ TPL-> config_dir = _ site_root. "/configs /";
    $ TPL-> cache_dir = _ site_root. "/Cache /";
    $ TPL-> left_delimiter = '<{';
    $ TPL-> right_delimiter = '}> ';
    ?>
      
    The purpose set in the above method is that if the program is to be transplanted to other places, you only need to change _ site_root. (Refer to xoops here)
      
    After the template path of smarty is set, the program will follow this path to capture the relative positions of all templates (in this example, 'd:/appserv/web/demo/templates /'). Then we use the smarty method of Display () to display our template.
      
    Next, we will place a test.htm In the Templates folder: (it doesn't matter what the extension name is, but it is easy for visual designers to develop. I still use. HTM as the main tool .)
      
    Templates/test.htm:
    <HTML>
    <Head>
    <Meta http-equiv = "Content-Type" content = "text/html; charset = big5">
    <Title> <{$ title}> </title>
    </Head>
    <Body>
    <{$ Content}>
    </Body>
    </Html>
      
    Now we want to display the template above and change the webpage title ($ title) and content ($ content). Please name the following file content as test. PHP and put it in the main Folder:
      
    Test. php:
    <? PHP
    Require "Main. php ";
    $ TPL-> assign ("title", "webpage title for testing ");
    $ TPL-> assign ("content", "tested webpage content ");
    // The above two rows can also be replaced by this line
    // $ TPL-> assign (Array ("title" => "webpage title for testing", "content" => "webpage content for testing "));
    $ TPL-> display('test.htm ');
    ?>
      
    Open your browser and enter http: // localhost/demo/test. php (depending on your environment). You will see the following picture:
       
    Next under templates_c, we will see a strange folder (% 179), and clicking on it is also a strange folder (% 1798044067), where there is a file:
      
    Templates_c/% 179/% 1798044067/test.htm. php:
    <? PHP/* smarty version 2.6.0, created on 2003-12-15 22:19:45 compiled from test.htm */?>
    <HTML>
    <Head>
    <Meta http-equiv = "Content-Type" content = "text/html; charset = big5">
    <Title> <? PHP echo $ this-> _ tpl_vars ['title'];?> </Title>
    </Head>
    <Body>
    <? PHP echo $ this-> _ tpl_vars ['content'];?>
    </Body>
    </Html>
      
    That's right. This is the files compiled by smarty. It converts the variables in the template into PHP syntax for execution. The next time we read the same content, Smarty will directly capture this file for execution.
      
    Finally, let's sort out the entire process of writing the smarty program:
      
    Step 1. Load the smarty template engine.
      
    Step 2. Create a smarty object.
      
    Step 3. Set the parameters of the smarty object.
      
    Step 4. process the variables in the program, and then use the Assign Method of smarty to place the variables into the template.
      
    Step 5. Use the display method of smarty to show the webpage.
      
      How to arrange your program architecture
      
    In addition to the folders required by smarty (class, configs, templates, and templates_c), we can see two folders: Train des and modules. In fact, this is built by the author imitating the xoops architecture, because xoops is one of the programs I have come into contact with, and a few of the station programs that use the smarty template engine. Although the program architecture like this is not as powerful as the xoops 1%, there is at least xoops to support it.
      
    The connectors folder is mainly used to place some functions and SQL scripts, so that they can be introduced in Main. php, as shown below:
      
    Main. php:
      
    <? PHP
    Include "Class/smarty. Class. php ";
    Define ('_ site_root', 'd:/appserv/web/demo'); // No diagonal lines at last
    // Base on the location of Main. php
    Require_once "des/functions. php ";
    Require_once "des/include. php ";
    $ TPL = new smarty ();
    $ TPL-> template_dir = _ site_root. "/templates /";
    $ TPL-> compile_dir = _ site_root. "/templates_c /";
    $ TPL-> config_dir = _ site_root. "/configs /";
    $ TPL-> cache_dir = _ site_root. "/Cache /";
    $ TPL-> left_delimiter = '<{';
    $ TPL-> right_delimiter = '}> ';
    ?>
      
    The modules folder is used to place program modules, so that programs won't be lost, and the overall architecture is clear at a glance.
      
    As we mentioned above, Main. php is the main core of the entire program. It starts here, whether it is constant definition, external program loading, and shared variable creation. Therefore, all subsequent modules need to include this file. Therefore, during the program process planning, you must have a good idea of the things that should be put in Main. php; of course, it is better to use the include or require instructions to clearly separate each link.
       
    In step 5 of the smarty program mentioned in the previous section, Main. php will help us to complete the first three steps first, and the subsequent module programs only need to perform the next two steps.
      
      Start with Variable
      
    How to Use Variables
      
    From the examples in the previous chapter, we can clearly see that we use the two signs <{And}> to package variables. The default identifier is {And}, but for the relationship between the text rush code and JavaScript, the author still imitates xoops and replaces the identifier. The naming method of variables is the same as that of PHP variables. There is also a $ font (which is different from the general template engine ). The identifier is a bit like the <? PHP and?> (In fact they will be replaced with this), so the following template variables are feasible:
      
    1. <{$ var}>
      
    2. <{$ var}> <! -- There is a space between it and the variable -->
      
    3. <{$ VaR
      
    >><! -- The start and end signs are not in the same line -->
    In smarty, the preset variables are global, that is, you only need to specify them once. If you specify more than two times, the variable content will be based on the last one specified. Even if we load external subtemplates in the main template, the same variables in the subtemplate will also be replaced, so that we no longer need to parse the subtemplate.
      
    In the PHP program, we use the assign of smarty to place variables in the template. The usage of assign has been written much in the official manual, as shown in the example in the previous section. However, when we repeat the block, we must do something about the variable before we can sign the variable assign into the template, which will be mentioned in the next chapter.
      
      Modify Your Variables
      
    As we mentioned above, the style of the smarty variable is determined by the template. Therefore, smarty provides many types of variables that can be modified. The method is as follows:
      
    <{Variable | modifier}> <! -- When the modifier has no parameters -->
      
    <{Variable | modifier: "parameter (optional, depending on the function)"}> <! -- When the modifier has parameters -->
    Example:
      
    <{$ Var | nl2br}> <! -- Replace the wrap character in the variable with <br/> -->
      
    <{$ Var | string_format: "% 02d"}> <! -- Format the variable -->
    Well, why do we need the template to determine the style of variables? Let's take a look at the HTML below. This is part of a shopping cart checkout screen.
      
    <Input name = "Total" type = "hidden" value = "21000"/>
      
    Total amount: 21,000 Yuan
    Generally, the template engine template may be written as follows:
      
    <Input name = "Total" type = "hidden" value = "{total}"/>
      
    Total amount: {format_total} RMB
    In their PHP program, write as follows:
      
    <? PHP
    $ Total = 21000;
    $ TPL-> assign ("Total", $ total );
    $ TPL-> assign ("format_total", number_format ($ total ));
    ?>
      
    The smarty template can be written as follows: (The number_format modifier can be downloaded from the smarty official website)
      
    <Input name = "Total" type = "hidden" value = "<{$ total}>"/>
      
    Total amount: <{$ Total | number_format: ""}> RMB
    In the PHP program of smarty, write as follows:
      
    <? PHP
    $ Total = 21000;
    $ TPL-> assign ("Total", $ total );
    ?>
      
    Therefore, in smarty, we only need to specify the variable once and leave the remaining variable to the template. Do you understand this? This is the benefit of making the template decide the display style of variables on its own!
      
      Control template content
      
    Duplicate Blocks

      
    In the smarty sample, there are two ways to repeat a block: foreach and section. In the program, we need an assign array, which can contain an array. As in the following example:
      
    First, let's look at how the PHP program is written:
      
    Test2.php:
      
    <? PHP
    Require "Main. php ";
    $ Array1 = array (1 => "apple", 2 => "pineapple", 3 => "banana", 4 => "happy ");
    $ TPL-> assign ("array1", $ array1 );
    $ Array2 = array (
    Array ("index1" => "data1-1", "index2" => "data1-2", "index3" => "data1-3 "),
    Array ("index1" => "data2-1", "index2" => "data2-2", "index3" => "data2-3 "),
    Array ("index1" => "data3-1", "index2" => "data3-2", "index3" => "data3-3 "),
    Array ("index1" => "data4-1", "index2" => "data4-2", "index3" => "data4-3 "),
    Array ("index1" => "data5-1", "index2" => "data5-2", "index3" => "data5-3 "));
    $ TPL-> assign ("array2", $ array2 );
    $ TPL-> display ("test2.htm ");
    ?>
      
    The template is written as follows:
      
    Templates/test2.htm:
      
    <HTML>
    <Head>
    <Meta http-equiv = "Content-Type" content = "text/html; charset = big5">
    <Title> test duplicate blocks </title>
    </Head>
    <Body>
    <PRE>
    Use foreach to present array1
    <{Foreach item = Item1 from = $ array1}>
    <{$ Item1}>
    <{/Foreach}>
    Use section to present array1
    <{Section name = sec1 loop = $ array1}>
    <{$ Array1 [sec1]}>
    <{/Section}>
    Use foreach to present array2
    <{Foreach item = index2 from = $ array2}>
    <{Foreach key = key2 item = item2 from = $ index2}>
    <{$ Key2 }>:< {$ item2}>
    <{/Foreach}>
    <{/Foreach}>
    Use section to present array1
    <{Section name = sec2 loop = $ array2}>
    Index1: <{$ array2 [sec2]. index1}>
    Index2: <{$ array2 [sec2]. index2}>
    Index3: <{$ array2 [sec2]. index3}>
    <{/Section}>
    </PRE>
    </Body>
    </Html>
      
    After the preceding example is executed, we find that the execution results of both foreach and section are the same. So what is the difference between the two?
      
    The first difference is obvious, that is, foreach needs to present the two-layer array variables of our assign in the form of nest processing, while section uses the "Main array [loop name]. sub-array index "to present the entire array. From this we can see that the foreach of smarty in the template is the same as the foreach in PHP, while the Section is the description developed by smarty to process the array variables listed above. Of course, this is not just the function of Section. In addition to the nested data presentation mentioned in the next section, several application examples of Section are also provided in the official manual.
      
    However, it should be noted that the array index thrown to the section must be a positive integer starting from 0, that is, 0, 1, 2, 3 ,.... If your array index is not a positive integer starting from 0, you must use foreach to present your data. You can refer to this article in the official forum to discuss section and foreach usage.
      
      Presentation of nest data
      
    The most annoying thing about the template engine is the presentation of nest-like data. Many famous template engines specifically emphasize this, but it is a pediatrics for smarty.
      
    For the most common nest data, let's talk about the topic area in the attention program. Assume that the result to be presented is as follows:
      
    Announcement Area
      
    Website Service Announcement
      
    Literature Area
      
    Introduction to good books
      
    Qiwen
      
    Computer Area
      
    Hardware peripheral
      
    Software Discussion
      
    In the program, we take static data as an example:
      
    Test3.php:
      
    <? PHP
    Require "Main. php ";
    $ Forum = array (
    Array ("category_id" => 1, "category_name" => "announcement Area ",
    "Topic" => array (
    Array ("topic_id" => 1, "topic_name" => "website announcement ")
    )
    ),
    Array ("category_id" => 2, "category_name" => "文 ",
    "Topic" => array (
    Array ("topic_id" => 2, "topic_name" => "Good Book Introduction "),
    Array ("topic_id" => 3, "topic_name" => "surprise ")
    )
    ),
    Array ("category_id" => 3, "category_name" => "computer area ",
    "Topic" => array (
    Array ("topic_id" => 4, "topic_name" => "hardware peripherals "),
    Array ("topic_id" => 5, "topic_name" => "software discussion ")
    )
    )
    );
    $ TPL-> assign ("Forum", $ Forum );
    $ TPL-> display ("test3.htm ");
    ?>
      
    The template is written as follows:
      
    Templates/test3.htm:
      
    <HTML>
    <Head>
    <Title> nested loop test </title>
    </Head>
    <Body>
    <Table width = "200" border = "0" align = "center" cellpadding = "3" cellspacing = "0">
    <{Section name = sec1 loop = $ forum}>
    <Tr>
    <TD colspan = "2"> <{$ Forum [sec1]. category_name}> </TD>
    </Tr>
    <{Section name = sec2 loop = $ Forum [sec1]. Topic}>
    <Tr>
    <TD width = "25"> </TD>
    <TD width = "164"> <{$ Forum [sec1]. Topic [sec2]. topic_name}> </TD>
    </Tr>
    <{/Section}>
    <{/Section}>
    </Table>
    </Body>
    </Html>
      
    The execution result is the same as the example given by the author.
      
    Therefore, in the program, we only need to find a way to plug a layer of repeated values into the array, and then use the <{first layer group [loop 1]. the second layer group [loop 2]. layer 3 array [loop 3]... array Index}> to display the values in each nested loop in this way. What method is used? In the next section, we will discuss how to use the database.
      
      Convert data in the database
      
    We mentioned how to display nested loops. In fact, our data may be captured from the database during application, therefore, we have to find a way to convert the database data into the above multi-array form. Here, the author uses a database category to capture information in the database, you can use your favorite method.
      
    We only modify the PHP program, and the template is the one above (this is the benefit of the template engine ~), Here, the $ db object is assumed to have been established in main. php, and the obtained information is the above example.
      
    Test3.php:
      
    <? PHP
    Require "Main. php ";
    // Create the first layer group first
    $ Category = array ();
    $ Db-> setsql ($ sql1, 'category ');
    If (! $ Db-> query ('category ') Die ($ db-> error ());
    // Capture the first layer of circular data
    While ($ item_category = $ db-> fetchassoc ('category '))
    {
    // Create a second-tier Group
    $ Topic = array ();
    $ Db-> setsql (sprintf ($ sql2, $ item_category ['category _ id']), 'topic ');
    If (! $ Db-> query ('topic ') Die ($ db-> error ());
    // Capture the second-level circular data
    While ($ item_topic = $ db-> fetchassoc ('topic '))
    {
    // Push the captured data into the second layer Group
    Array_push ($ topic, $ item_topic );
    }
    // Specify the second layer group as a member of the data captured by the first layer Group
    $ Item_category ['topic '] = $ topic;
    // Push the first layer of data into the first layer Group
    Array_push ($ category, $ item_category );
    }
    $ TPL-> assign ("Forum", $ category );
    $ TPL-> display ("test3.htm ");
    ?>
      
    After the database captures a piece of data, we get an array containing the data. Using the while statement and the array_push function, We can insert data in the database into the array. If you only use a single-layer loop, remove the second-layer loop (the red part.
      
      Determines whether the content is displayed.
      
    To determine whether to display the content, we can use the if syntax for selection. For example, if the user has logged in, our template can be written as follows:
      
    <{If $ is_login = true}>
    Show user operation menus
    <{Else}>
    Display the input account and password form
    <{/If}>
      
    Note that there must be at least one space character on both sides of the "=" sign. Otherwise, the smarty cannot be parsed.
      
    For the general application of if syntax, refer to the official instructions, so I will not introduce it here. However, I found an interesting application: It is often seen that a table is generated in the program: (numbers represent the sequence of data sets)
      
    1 2
      
    3 4
      
    5 6
      
    7 8
      
    This is what I call "Horizontal repeat table 」. Its features are different from the traditional vertical repetition. The duplicate tables we see in the previous sections are from top to bottom, with only one piece of data in one column. The horizontal repeat table can generate n pieces of data in one column horizontally, and then replace the next column until the entire loop ends. To achieve this function, you only need to combine section and if in the simplest way.
      
    Let's take a look at the following example:
      
    Test4.php:
      
    <? PHP
    Require "Main. php ";
    $ My_array = array (
    Array ("value" => "0 "),
    Array ("value" => "1 "),
    Array ("value" => "2 "),
    Array ("value" => "3 "),
    Array ("value" => "4 "),
    Array ("value" => "5 "),
    Array ("value" => "6 "),
    Array ("value" => "7 "),
    Array ("value" => "8 "),
    Array ("value" => "9 "));
    $ TPL-> assign ("my_array", $ my_array );
    $ TPL-> display('test4.htm ');
    ?>
      
    The template is written as follows:
      
    Templates/test4.htm:
      
    <HTML>
    <Head>
    <Title> horizontal repeat table test </title>
    </Head>
    <Body>
    <Table width = "500" border = "1" cellspacing = "0" cellpadding = "3">
    <Tr>
    <{Section name = sec1 loop = $ my_array}>
    <TD> <{$ my_array [sec1]. Value}> </TD>
    <{If $ smarty. Section. sec1.rownum is Div by 2}>
    </Tr>
    <Tr>
    <{/If}>
    <{/Section}>
    </Tr>
    </Table>
    </Body>
    </Html>
      
    Focus on $ smarty. section. sec1.rownum: smarty variable. In the section loop, this variable gets the index value starting from 1. Therefore, when rownum can be split from 2, output </tr> <tr> to change table columns (note! Yes </tr> before <tr> after ). Therefore, number 2 is the number of data records we want to present in a column. You can change other different rendering methods.
      
      Load External content
      
    We can load the PHP program code or another sub-template in the template, using the pair de_php and include two smarty template syntaxes. The author of pair de_php is rarely used. You can query the official manual for usage, this is not described here.
      
    When using include, We can pre-load the subtemplate or dynamically load the subtemplate. Pre-loading is usually used with a common file header and copyright notice, while dynamic loading can be used in a unified framework page, and further achieve a Winamp-like skin. Of course we can also mix these two types, depending on the situation.
      
    Let's take a look at the following example:
      
    Test5.php:
      
    <? PHP
    Require "Main. php ";
    $ TPL-> assign ("title", "include test ");
    $ TPL-> assign ("content", "this is the variable in template 2 ");
    $ TPL-> assign ("dyn_page", "test5_3.htm ");
    $ TPL-> display('test5_1.htm ');
    ?>
      
    TEMPLATE 1 is written as follows:
      
    Templates/test5_1.htm:
      
    <HTML>
    <Head>
    <Meta http-equiv = "Content-Type" content = "text/html; charset = big5">
    <Title> <{$ title}> </title>
    </Head>
    <Body>
    <{Include file = "test5_2.htm"}> <br/>
    <{Include file = $ dyn_page}>
    <{Include file = "test5_4.htm" custom_var = "Custom variable content"}>
    </Body>
    </Html>
      
    Template 2 is written as follows:
      
    Templates/test5_2.htm:
      
    <{$ Content}>
    TEMPLATE 3 is written as follows:
      
    Templates/test5_3.htm:
      
    This is the content of template 3.
    TEMPLATE 4 is written as follows:
      
    Templates/test5_4.htm:
      
    <{$ Custom_var}>
    Note the following points: 1. The template position is based on the previously defined template_dir; 2. the variables in all the include child templates will also be interpreted .; 3. You can use "variable name = variable content" in "include" to specify the variables contained in the introduced template, as in TEMPLATE 4 above.

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.