? Success

User tests: Successful: Unsuccessful:

avatar LLNet
LLNet
18 Oct 2014
  • html
  • php
  • optimized code so we not open and close php for fun.
avatar LLNet LLNet - open - 18 Oct 2014
avatar jissues-bot jissues-bot - change - 18 Oct 2014
Labels Added: ?
avatar brianteeman brianteeman - change - 19 Oct 2014
Category Code style
avatar losedk
losedk - comment - 19 Oct 2014

I don't think this Code Style PR is in line with the general Joomla Coding Standards.

avatar brianteeman
brianteeman - comment - 13 Jan 2015

@javigomez Can you comment on the code style please


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4829.
avatar brianteeman brianteeman - change - 16 Jun 2015
Status Pending Needs Review
avatar brianteeman
brianteeman - comment - 16 Jun 2015

@javigomez waiting on you to comment before this can be either closed or moved forward


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4829.

avatar zero-24
zero-24 - comment - 16 Jun 2015

hmm for my personal view we should use

<?php if (whatever) : ?>
<?php // Do what ever you want to do ?>
<?php endif; ?>

It is most smaler code and easier to read in views. As there should be majority HTML Code. ;) For models and other stuff like classes etc. I agree with:

<?php if (whatever)
{
 // Do what ever you want to do
}

In the last time we merge a lot of the first type of code. But the PLT needs to take that if we want to change all the files again :smile:

avatar Bakual
Bakual - comment - 16 Jun 2015

In layout files, we use

<?php if (whatever) : ?>
<?php // Do what ever you want to do ?>
<?php endif; ?>`

Except in the first PHP block at the very beginning of the file. There we usually use

<?php if (whatever)
{
 // Do what ever you want to do
}

Reason is that the first variant is supposed to be easier to understand by frontend guys and regular users. You can also easier move blocks around without creating fatal errors due to missing <?php ... ?> tags and the like.

So this PR doesn't follow our codestyle for the most part.

I'm closing it.

avatar Bakual Bakual - change - 16 Jun 2015
Status Needs Review Closed
Closed_Date 0000-00-00 00:00:00 2015-06-16 19:53:12
Closed_By Bakual
avatar Bakual Bakual - close - 16 Jun 2015

Add a Comment

Login with GitHub to post a comment