Gui : The Zoop View (powered by Smarty)

Zoop uses the excellent Smarty templating system. Zoop's Gui component provides some extra functionality not provided in the core Smarty system, but for the most part it is Smarty. One of the large differences is that Smarty uses a Smarty object called $smarty by default, in Zoop that object is called $gui. For the most part it is just a little easier to type $gui than $smarty as it is fewer characters.

Zoop is completely usable without the gui component (Smarty) and you are welcome to echo all of your content to the browser inside of your page functions, however we strongly recommend using the gui component for most projects as there are so many advantages to doing so.

The usage of a templating system such as Smarty helps to promote MVC or a separation of logic and layout.

Location

In Zoop by default the template files are located in app_dir/templates/default.

Settings for the gui component are defined in app_dir/config/gui.php.

Also by default gui compiles templates and caches them. The temporary cached files are created in app_dir/tmp/gui which must be writable by the web server. Substantial speed benefits can be achieved by using this compile and cache method and we recommend using it (it is enabled by default).

Format

The Zoop Gui Component uses the standard Smarty template file format.

Smarty template files are a mixture of HTML and Smarty tags. A Smarty tag looks like {$var}. Smarty template files have the extension .tpl.

Extend Hello World to use Templates.

Let's use some templates in our Hello World application. First step is to create a template file. Create the file app_dir/templates/default/helloworld.tpl and place the following content into it.

<html>
<head><title>{$hw}</title></head>
<body>
<h1>{$hw}</h1>
</body>
</html>

Now lets return to the zone_default.php file and edit the pageDefault function we used previously.

The $gui object is a global object already instantiated for us. All we need to do is to declare it as global to be able to access it in our page function. Once we have access to the $gui object we need to tell it what to set the {$hw} variable to that we referenced in the tpl file. Lastly we need to tell the $gui object to display this tpl.

Our pageDefault function should look like this:

pageDefault($inPath)
{
	global $gui;
 
	$gui->assign("hw", "Hello World");
 
	$gui->display("helloworld.tpl");
}

Lets visit the same page in the web browser as we did previously, http://example.com/app_dir/ . We should see something similar to the screenshot below.

Generally zoop is your

Generally zoop is your application directory and this can be use that caching files which the web server needs a place to store.The information available here is great thanks for sharing.
Craigslist Greensboro

sara 03 May 2011

I sure got to learn so much

I sure got to learn so much from your site. Thanks and keep up, I enjoyed your work. Holiday deals and packages - villas in Greece | Disneyland Florida holidays

suzettech 28 Nov 2011

I am glad to have landed in

I am glad to have landed in the post for its useful lesson on introduction of the menu attributes module in drupal. I think I've been benefited by the essential tutorial. Due Date Calculator

bobreel 03 Feb 2012

ZOOP

Zoop Framework is so far the best one. It's GUI feature do have some of the extra functionality than the Smarty system. I have came across many important information across this site. It was really very informative.
pet medications

christoffercaron 01 Jul 2011

Zoop is completely usable

Zoop is completely usable without the gui component (Smarty) and you are welcome to echo all of your content to the browser inside of your page functions, however we strongly recommend using the gui component for most projects as there are so many advantages to doing so.
love quotes

jonisonis 15 Aug 2011

No doubt Zoop is using good

No doubt Zoop is using good template system.i like to read informative blogs and this blog is also so good and helpful.thanks for taking time to discus this topic..
Craigslist Tennessee

kijijiie49 26 Oct 2011

Craigslist san diego motorcycles

Smarty templating system is excellent and perfect for Zoop.you share some good points in this post.i like to read informative blogs and this blog is also so good and helpful.thanks for taking time to discus this topic..
Craigslist san diego motorcycles

rohaangee 16 Nov 2011

70-236 braindumps || 220-602

70-236 braindumps || 220-602 braindumps || 642-436 braindumps || 70-294 braindumps || 70-648 braindumps || 640-863 braindumps || 70-293 braindumps || 350-018 braindumps ||

Its not the case that reader must be completely agreed with author's views about article. So this is what happened with me, anyways its a good effort, I appreciate it. Thanks

Leo123 09 Dec 2011

Daily Jammu Kashmir

The following article actually established my very own little brown eyes towards the several merchants which usually organizations currently have by means of internet marketing.i like to read informative blogs and this blog is also so good and helpful.thanks for taking time to discus this topic..
Daily Jammu Kashmir

kingston123 12 Jan 2012

reply

Thanks for the nice blog. It was very useful for me. Keep sharing such ideas in the future as well. This was actually what I was looking for, and I am glad to came here! Thanks for sharing the such information with us.
cartucce compatibili
elettronica

jacklavoro 17 Jan 2012

I would talk about that many

I would talk about that many of us visitors actually are definitely gifted to remain in a awesome website with very many exclusive professionals with useful information. hcg diet

bobreel 04 Feb 2012