PHP And Javascript Libraries

Views:
 
     
 

Presentation Description

Learn how added an retrieve JavaScript libraries and CSS from PVLibraries in Prodigyview..

Comments

Presentation Transcript

JavaScript Libraries: 

JavaScript Libraries JavaScript Makes Things Sexy

Overview: 

Overview Objective Learn the basics of adding JavaScript and CSS in ProdigyView . Requirements Understanding of the DEFINES Estimated Time 10 Minutes

Follow Along With Code Example: 

Follow Along With Code Example Download a copy of the example code at www.prodigyview.com/source . Install the system in an environment you feel comfortable testing in. Proceed to examples/system/ Libraries_Javascript.php

Separation of Libraries: 

Separation of Libraries ProdigyView natively support 5 different file types that can be added to PVLibraries . 1 of them is CSS, and the others are variations of JavaScript and JavaScript Frameworks.

Queuing Libraries: 

Queuing Libraries Add JavaScript files Add JQuery Files Add Prototype Files Add Mootools Files Add CSS Files

Queued Scripts: 

Queued Scripts Queuing a script does not actually add the script into the code, but creates a reference to that script. It is up to the developer to tell where that script exist. An easy way of placing the scripts is using the defines discussed in an earlier tutorial.

Adding Open Script: 

Adding Open Script Unlike the other files that pertain to a certain type, open script is any type of content(JavaScript, meta tags, properties, etc ). How you add your content to open script is exactly how it will be outputted later . 1. Explicitly write the full script 2. Add the script to the open script queue

Javascript Libraries: 

Javascript Libraries The first library we are going to pull is the regular JavaScript files added. Technically any kind of JavaScript file can be queued and pulled, but any files queued to the JavaScript queue should be stored in the same location as the PV_JAVASCRIPT define. 1. Pull the queue and return an array 2. Use the PV_JAVASCRIPT to set the location of your script

JQuery Libraries: 

JQuery Libraries Similar to how we retrieved the JavaScript libraries, we can also get the queued JQuery files. The JQuery define, PV_JQUERY , should be used in this instance as the location where the file exist.

Prototype Libraries: 

Prototype Libraries Our next files to retrieve are the libraries specific to prototype. Prototype libraries used the PV_PROTOTYPE define for the location where the script exist.

Mootools Libraries: 

Mootools Libraries Our last natively supported JavaScript library files is mootools . The mootools files should correspond with the PV_MOOTOOLS define.

CSS Files: 

CSS Files The css files that were originally added to PVLibraries can be retrieved at anytime as well. The PV_CSS defines sets their location.

Retrieving Open Script: 

Retrieving Open Script Open scripting, being that it is any information that you want to pass the header, does not have a set location nor needs to be iterated through. It simply comes back as a string of text that needs to be printed out.

Output: 

Output If you ran the example as a script, your output should look like below.

Heads Up!: 

Heads Up! The real importance of learning how to queue libraries is because these libraries are tightly integrated with the template manager in ProdigyView . In the tutorials on the templating system, you will learn how to pull these libraries directly into your html and have them be formatted .

API Reference: 

API Reference For a better understanding of the libraries, visit the api by clicking on the link below. PVLibraries www.prodigyview.com More Tutorials For more tutorials, please visit: http:// www.prodigyview.com /tutorials