Hey PHP guys... OOP question

https://news.ycombinator.com/item?id=673563
by eintnohick • 17 years ago
7 13 17 years ago

I was wondering if you guys could explain something to me. I'm developing a new website based on CakePHP and am curious as whether it would be beneficial (faster and less code) to replace:

//Controller

$this->data['text_learn'] = $this->language->get('text_learn');

//Language

$_['text_learn'] = 'Learn About Our Website';

//View

<?php echo $text_learn; ?>

Simply with:

//View

<?php echo 'Learn About Our Website'; ?>

I'm trying hard to understand why it would be beneficial to have all that excess code when I could simply echo out the text; especially in cases where it is only used once.

Related Stories

Loading related stories...

Source preview

news.ycombinator.com