On 03/27/2010 08:09 PM, Johannes Schlüter wrote:
You can always use a (temporary) alias to shorten things
$myLongNameObject = new MyLongNameObject();
$t = $myLongNameObject;
$t->property1 = '11111';
$t->property2 = '22222';
$t->property3 = '33333';
$t->property4 = '44444';
$t->property5 = '55555';
unset($t);
Yes, I use this and I should in any way (with shorthand syntax too),
but, how I describe one post before - It help not a much. This just a
short sample of code. In big code anyway no readable.
That won't work easily as there's a conflict between other local
variables. So this might only work with very specific expressions,which
is then mostly useless. Syntax-wise it /could/ work like this:
with ($MyLongNameObject) {
->property1 = '1111';
->property2 = '2222';
}
Ok, I just describe idea, but not an implementation.
but there's no big benefit over an alias but way more confusion with a
new syntax, a new keyword, ...
Unfortunately for UI plenty of code is necessary. And in future more web
application will be use Dynamic UI. And it is tendency - use server side
generator for client side dynamic UI - here is many advantage -
No needed work directly with DOM+CSS+HTML+JavaScript, which distinguish
from one browser to other, It let change UI to user - from
administrative panel (with modify UI implementation) - in CMS, for
example... So, I found this idea in JavaScript, when possible to
initialize object like { attribute1 = value1, attribute2 = value2 } and
it is very helpful. But much better use PHP UI framework, which produce
HTML,CSS,JavaScript code, than write lot of code in many environment.
Plus PHP OOP model much better than others.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php