Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author vasyl_m

    (@vasyl_m)

    Hi igov,
    Did I understand you right? You ask me to learn PHP ??
    So I’ll try to guess what you mean.

    It might be you PHP parser does not recognize the <?= which is a shortcut for <?php echo. If it is true, than I’ll change it, based on PEAR Coding Standards.

    In case you are wondering what $factory->lang(‘…’) means, I designed the code by using several patterns. One of them is Factory pattern which I’m using to handle the connection between plugin and CMS platform like WordPress. The same code can be easily adopted for Drupal, Joomla or any other system. This is kind of framework.

    Regards,
    Vasyl

    Thread Starter igov

    (@igov)

    Funny ??
    WordPress offers nice way of localization https://codex.www.ads-software.com/Translating_WordPress#Localization_Technology
    Better instead of your own classes.

    <?= is disabled by default in recent versions of PHP. <?php cannot be disabled ?? For best compatibility use <?php echo …. instead of <?=

    Matter of coding standards!

    Plugin Author vasyl_m

    (@vasyl_m)

    Hi igov,
    If you go deeper into “my own class” you’ll find out that I’m using WordPress nice way of localization ??
    My goal was not to reinvent the wheel but create a framework which can be used for other platforms. Let say Typo3 or Drupal has different localization mechanism than WordPress. And module Factory knows how to handle that.
    The entire code is platform independent and does not have any single line of code for specific CMS. There are only two places related to WordPress – main file (manager.php) and in Factory Module – wordpress.php.

    Regarding <?= you might be right. It is already changed for next release. In any way it was my mistake to use the shortcut.

    Regards,
    Vasyl

    Plugin Author vasyl_m

    (@vasyl_m)

    Oh, and by the way, appreciate your interest in WP Bug Tracker.

    Plugin Author vasyl_m

    (@vasyl_m)

    Hi igov,
    The issue was fixed in release 1.2.

    Thanks for feedback.
    Vasyl

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Improve your coding style’ is closed to new replies.