0

Consider:

public static function get_publish_flag_values()
{
    return array(
        self::PUBLISH_FLAG_ON => __('model.item.publish_flag_values.on'),
        self::PUBLISH_FLAG_OFF => __('model.item.publish_flag_values.off')
    );
}

In FuelPHP, where can I find the use of _('mode.item.product_code')?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
samurai
  • 15
  • 2
  • 3
    It's a function name. Terribly counter intuitive function name. – zerkms Aug 07 '14 at 02:05
  • Not sure about fuelphp, but it [looks like a translation function](http://stackoverflow.com/questions/1777131/double-underscore-in-php). – Jared Farrish Aug 07 '14 at 02:06
  • Related (perhaps even a duplicate - the answers talk about some other frameworks, like [WordPress](https://en.wikipedia.org/wiki/WordPress) and [CakePHP](https://en.wikipedia.org/wiki/CakePHP), but they could just as well have mentioned [FuelPHP](https://en.wikipedia.org/wiki/FuelPHP)): *[Double underscore in PHP](https://stackoverflow.com/questions/1777131/)* – Peter Mortensen Feb 23 '22 at 15:03

2 Answers2

4

It is in fuel/app/lang, and if you use modules, it is in fuel/app/modules/lang. It returns an array.

iatboy
  • 1,295
  • 1
  • 12
  • 19
0

__() is simply an alias for Lang::get. See the Lang class documentation.

It's used as often people prefer the shorter syntax.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Emlyn
  • 852
  • 6
  • 16