473,385 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

object probleme

I've created an instance of a class
$smarty = new smarty();
then I create an other instance of an other class and sending the
$smarty instance to that class
$user = new user($smarty);
This is the user class

class user {
var $smarty
function user($smartyInstance){
$smarty = $smartyInstance;
// but when I do
$smarty->method("some parameters");
// it doesn't work
// how fix it ?
}
}

Jul 17 '05 #1
1 1544

On 16-Oct-2003, Geiregat Jonas <en***@sdf-eu.org> wrote:
I've created an instance of a class
$smarty = new smarty();
then I create an other instance of an other class and sending the
$smarty instance to that class
$user = new user($smarty);
This is the user class

class user {
var $smarty
function user($smartyInstance){
$smarty = $smartyInstance;
// but when I do
$smarty->method("some parameters");
// it doesn't work
// how fix it ?
}
}


$smarty is local to the function named user. If you want to refer to the
class variable you need to use $this->smarty like:

class user {
var $smarty;
function user($smartyInstance){
$this->smarty = $smartyInstance;
$this->smarty->method("some parameters");
}
}


--
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to ja*********@willglen.net (it's reserved for spammers)
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: cyril | last post by:
Bonjour à tous, j'utilise Apache php et mysql sans probleme, j'ai voulu passer pour des raisons pro sur IIS PHP MS SQL.IIS et PHP fonctionne bien, j ai decommenté la ligne pour ms sql, copier la...
2
by: grigoo | last post by:
bonjour a tous je me presente a vous::: greg dit le grigoo sur le web ,,etudiant en bioinformatique a montreal et jusqu au cou dans notre language prefere....java. et biojava.. et je suis en un...
1
by: Bijay Kumar | last post by:
Hi Guys, I was going through the source code of Object.cs in rotor. What I found is Equals() implemented as follows: public extern virtual bool Equals(Object obj); What I don't...
0
by: Jan Metzger | last post by:
Probleme mit JOIN und COUNT, da ich sehr experimentierfreudig bin, versuche ich von zeit zu zeit neue Tabellen und abfragen-konstrukte für meine Community... da ich mir alles was ich über PHP...
2
by: loki | last post by:
hello, when i do ..... set xmlhttp = CreateObject("WinHTTP.WinHTTPRequest.5.1") ...... StrXmlhttpResponseText = xmlhttp.responseText StrXmlhttpResponseText = replace(StrXmlhttpResponseText,...
1
by: Badboy36 | last post by:
Hello user from googlegroups, i made a microsoft access database with front and backend. i created the backend in microsoft access97. for the frontend i made two versions (one for microsoft...
0
by: fishomen | last post by:
hello i have probome with my seesion_start. it make the browser (ie6) to make like it is loading, allthought it finish to load. it shoe that it still loading the page with the green status bar. ...
1
by: Michael M. | last post by:
off topic question: Forum for computer science / Informatik-Probleme? Is there a forum for computer science problems? (web or newsgroup etc.) For example, need to solve intersection problems. etc.
2
by: Winkl | last post by:
Hallo zusammen, ich bin gerade dabei meine 1. Homepage unter ASP.NET (VB) zu machen. Habe bis jetzt nur Erfahrung unter Access+VBA. Dabei sind folgende Probleme/Fragen aufgetreten: 1. Gibt es...
13
by: GeezerButler | last post by:
Is an object reference stored as a 32 bit value? In other words, is a simple read or write of an object reference an atomic statement?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.