CHAPTER 11 MODIFYING PHPBB 339 Table 11-4. (Free php web host)

CHAPTER 11 MODIFYING PHPBB 339 Table 11-4. Common Template Engine Methods phpBB Method Description assign_vars([array]) Assigns an array of template variables for use in your page. These variables are, in turn, inserted in your templates and display content onscreen. assign_block_vars([array]) Similar to assign_vars(), except this function is used in loops (such as in the Forum Index, View Topic, and View Forum pages, to name a few). set_filenames([array]) Takes an array of filenames and associated identifiers that represent the files that make up the template. pparse($identifier) Parses the template file associated with the identifier that is passed in to HTML. This helps to produce the final output. In developing your modifications, you will most likely be working with the assign_vars() and assign_block_vars() methods the most, as these create the necessary template variables for output. Listing 11-4 demonstrates how to assign template variables. Listing 11-4. Assigning Template Variables assign_vars(array(’UNO’ => $one, ‘DOS’ => $two, ‘TRES’ => $three) ); ?> As you can see, Listing 11-4 defines three PHP variables and assigns them the template variable names UNO, DOS, and TRES, using PHP s in-line array definition. Now, you can write a template calling these variables, as shown in the snippet of template code in Listing 11-5. Listing 11-5. Using Template Variables

I am counting!
{UNO}
{DOS}
{TRES}

In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.

Leave a Reply