patTemplate Call in Joomla! 1.5

A general technical discussion area for patTemplate.
Locked
User avatar
musicones
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 176
Joined: Fri Aug 19, 2005 5:52 am

patTemplate Call in Joomla! 1.5

Post by musicones » Wed Aug 09, 2006 10:44 am

Hi,

could someone please tell me how to call patTemplate in Joomla! 1.5?

Before I did it like this:

Code: Select all

function &createTemplate() {
		global $option, $mosConfig_absolute_path;
		require_once( $mosConfig_absolute_path . '/includes/patTemplate/patTemplate.php' );

        }
		$tmpl =& patFactory::createTemplate( $option, true, false );
		$tmpl->setRoot( dirname( __FILE__ ) . '/tmpl' );

		return $tmpl;
	} 

	function showAbout() {
       // import the body of the page
        $tmpl =& showAbout::createTemplate();
        $tmpl->setAttribute( 'body', 'src', 'about.html' );

        $tmpl->displayParsedTemplate( 'form' );
	}
Where is it now and how do I call it?
A small code snip would help, thanks.

regards
Antonio Cambule

friesengeist
Joomla! Guru
Joomla! Guru
Posts: 842
Joined: Sat Sep 10, 2005 10:31 pm

Re: patTemplate Call in Joomla! 1.5

Post by friesengeist » Wed Aug 09, 2006 2:03 pm

Here are two files to look at:
/components/com_mailto/view.php
/components/com_mailto/views/default/default.php

This could change back to the usual contact.php and contact.html.php before Joomla! 1.5 goes beta though, that's why I included the exact revision number in the links. It should give you an idea how to use patTemplate.
We may not be able to control the wind, but we can always adjust our sails

User avatar
musicones
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 176
Joined: Fri Aug 19, 2005 5:52 am

Re: patTemplate Call in Joomla! 1.5

Post by musicones » Thu Aug 10, 2006 6:39 am

Hi,

that's a good example, thanks a lot.

Do you have one for admin/backend?


EDIT:

I've read various core codes under administrator/components now. Some of the core components are made with controllers and views.
I tried to recreate it for my component. It works well in a manner, that I can see my backend menu of the component, but thats depends on the .xml file.
When I click on a menu item I get a menubar with a close button, perfect.
And I can see my menuitems of the component under the title.

I've got an Item called "About", the task is "about" and the browser path is fine.

I've got

mycomponent
mycomponent/controllers/about.php
mycomponent/views/about.php


I suppose that in views/about.php should be the output for the component.
Now I can put what I want into showAbout function of the viewClass but nothing happens
nothing is shown.

what can it depend on?

regards
musicones
Last edited by musicones on Thu Aug 10, 2006 12:07 pm, edited 1 time in total.


Locked

Return to “patTemplate”