Sunday, September 29, 2013

Creating A Simple PHP MVC Framework Part 7C ,First Application- Template files (smarty version)

This is the last section of the template tutorial series. In this section, we will be creating the remaining template files for our application.
filename: web/themes/default/play.tpl
 
{% *Copyright: Lorenzo D. Alipio* %}
 {% *file: web/themes/default/play.tpl* %}  
 {% extends file="web/themes/default/main.tpl" %}  
 {% block name=title %}Playing {% $content.title %}{% /block %}  
 {% block name=meta %}{% /block %}  
 {% block name=metad %}{% /block %}  
 {% block name=general %}  
 <div class="span8">  
 <h4>Playing {% $content.title %}</h4>  
 <iframe id="youtube" width="100%" height="480" src="//www.youtube.com/embed/{% $content.v_id %}" frameborder="0" allowfullscreen></iframe>  
 <br/>  
 <!-- Related Videos -->  
 <div id="related">  
 <h3 class="title">Related Videos</h3>  
 <ul>  
 {% section name=item loop=$content.related %}  
 <li>  
 <a href="javascript:loadThisVideo('youtube','http://www.youtube.com/embed/{% $content.related[item].v_id %}?rel=0&amp;hd=1')"><img src="{% $content.related[item].thumb %}" title="{% $content.related[item].title %}"/></a>  
 </li>  
 {% /section %}  
 </ul>  
 </div>  
 <!-- end of related -->  
 </div>  
 <div class="span4">  
 <h5 class="title">Recommended Videos</h5>  
 <div id = "thumb3">  
 <ul>  
 {% section name=item loop=$content.video %}  
 <li>  
 <a href="javascript:loadThisVideo('youtube','http://www.youtube.com/embed/{% $content.video[item].v_id %}?rel=0&amp;hd=1')"><img src="{% $content.video[item].thumb %}"/></a>  
 <br/>  
 {% $content.video[item].title %}  
 <br/>  
 </li>  
 {% /section %}  
 </ul>  
 </div>  
 </div>  
 {% /block %}  


That concludes the template files creation. So far so  good, we are now finished with the template files. Next will be the youtube API class. You can view the screenshots of our application  here.

No comments:

Post a Comment