Personal tools

Creating an application with FrameIT

From Deep Thought

Jump to: navigation, search

FrameIT is Cyber Sprocket's application framework based on the model,view,controller (MVC) design and implementation methodology.

hatched: September, 2007
current residence: CSL's subversion repo at /wij_project

Contents

Installing On A New Site

cd /home/<sitename>/public_html mv .htaccess .htaccess_orig svn checkout <CSL SVN Repo/wij_project> .

Customizing A Site

The first thing most people will want to do with a web application is get a "coming soon" page online. With Frame IT the process is simple.

Page display is handled within the "view" area of the framework through the use of template (.tpl)files.

The "Home" Page

The home page template normally resides at /application/view/index/index.tpl.

Edit this file to create your page template.

For example:

Welcome To My Site<br>
New features coming soon!

Creating New "Sections"

New sections of the site (subdirectories) can be added by creating the controller and the view for the new addition.

To create a brands section, for example, you must first create the controller.

Create the file /application/controller/brands_controller.php that contains:

<?php
class brands_controller extends wij_controller {
	
	function index() {
		$this->set_attributes(array(
			'title'		=> "The title",
			'content'	=> "The content"
		));
		echo $this->get_template();
	}
	

	
}
?>

Note: be sure to change the class name to "brands_controller"


Then you just create your default view for the new section.

Create the file /application/view/brands/index.tpl that contains:

<b>Hello World!</b>

Template Basics

A template contains standard HTML as well as Frame IT specific markups.

Frame IT Specific HTML Markup

  • <%@ template_filename.tpl %> = include another template
  • <%= var_name %> = evaluate a Frame IT variable

Include File <%@ ... %> Details

The templates are stored in the /application/view directory. When an include template directive is encountered the system looks in the /application/view/<specific-view>/ directory first. If the included file is not found there the /application/view/ directory is searched.

It is common practice to store global (shared) templates in the main /appliation/view directory.

Example of an index page in /application/view/index/index.tpl:

<%@header%>
Welcome to Remodel Charleston.
<%@footer%>

Related Links

Frameit