Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Using or not using 'assign' and 'assignref'
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Richard  
View profile  
 More options Mar 21 2012, 2:24 pm
From: Richard <richardhell...@gmail.com>
Date: Wed, 21 Mar 2012 11:24:10 -0700 (PDT)
Local: Wed, Mar 21 2012 2:24 pm
Subject: Using or not using 'assign' and 'assignref'

In J1.5 examples and books, assign() and assignref() are used to pass data
from a view into the layout.
I noticed that these seem to be replaced in J1.6 and above by just adding
the data to the view object.
Are assign and assignref needed any more and if so, under what
circumstances should I use them?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hannes Papenberg  
View profile  
 More options Mar 21 2012, 2:54 pm
From: Hannes Papenberg <hackwa...@googlemail.com>
Date: Wed, 21 Mar 2012 19:54:04 +0100
Local: Wed, Mar 21 2012 2:54 pm
Subject: Re: [jgen] Using or not using 'assign' and 'assignref'
assign() and assignRef() are not needed anymore, since Joomla 1.6/2.5
requires at least PHP 5.2, which has far better memory management, which
is the main reason why those two methods were introduced. Those two
methods are assigning the variables by reference and not by value. PHP4
by default used assign by value, while PHP5 (when using objects) uses
assign by reference.

Bottom line: You don't need assign() and assignRef() anymore.

Hannes

Am 21.03.2012 19:24, schrieb Richard:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rouven Weßling  
View profile  
 More options Mar 21 2012, 3:22 pm
From: Rouven Weßling <m...@rouvenwessling.de>
Date: Wed, 21 Mar 2012 20:22:21 +0100
Local: Wed, Mar 21 2012 3:22 pm
Subject: Re: [jgen] Using or not using 'assign' and 'assignref'
If anyone's bored, I think a patch that gets rid of all calls to assign() and assignRef() would be awesome. They're not gonna be around forever and than we don't have to worry about them down the road.

Rouven

On 21.03.2012, at 19:54, Hannes Papenberg wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Xerosigma  
View profile  
 More options Aug 3 2012, 11:20 pm
From: Xerosigma <nestorle...@gmail.com>
Date: Fri, 3 Aug 2012 20:20:36 -0700 (PDT)
Local: Fri, Aug 3 2012 11:20 pm
Subject: Re: [jgen] Using or not using 'assign' and 'assignref'

How to we pass vars to the display then? I can't seem to get default.php to display mine. The print_r inside of the view prints the data just fine. O.O


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Dimitrov  
View profile  
 More options Aug 4 2012, 8:07 am
From: Daniel Dimitrov <danielsd...@yahoo.fr>
Date: Sat, 4 Aug 2012 05:07:24 -0700 (PDT)
Local: Sat, Aug 4 2012 8:07 am
Subject: Re: [jgen] Using or not using 'assign' and 'assignref'

Just use $this->variable = $something; in your view.html.php and it will be
available in the layout.
Cheers,
Daniel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nestor Ledon  
View profile  
 More options Aug 4 2012, 9:02 pm
From: Nestor Ledon <nestorle...@gmail.com>
Date: Sat, 4 Aug 2012 20:02:29 -0500
Local: Sat, Aug 4 2012 9:02 pm
Subject: Re: [jgen] Using or not using 'assign' and 'assignref'

Sweet. Got it working thanks.

On Sat, Aug 4, 2012 at 7:07 AM, Daniel Dimitrov <danielsd...@yahoo.fr>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
piotr_cz  
View profile  
 More options Nov 17 2012, 9:56 am
From: piotr_cz <pkoniec...@hotmail.com>
Date: Sat, 17 Nov 2012 06:56:35 -0800 (PST)
Local: Sat, Nov 17 2012 9:56 am
Subject: Re: [jgen] Using or not using 'assign' and 'assignref'

Just wondering, all core view classes ('view.html.php') in CMS 2.5 have
these variables ($data, $item) protected and thus cannot be set directly
from controller.
That's what Rouven was speaking about? To change to

View:
class HelloworldViewHello
{
  public $data;
  // ...

}

Controller:
$view->data = $data;

?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »