Welcome Guest, Not a member yet? Register   Sign In
Which template engine do you use..?
#41

[eluser]louis w[/eluser]
To chime in on the short tags convo. I would agree its normally not enabled, expecially on shared boxes. I had to enable it in my htaccess to be able to use them on my personal site.

But isn't the whole reason they are "ok" with CI is because it replaces them with long tags if the server does not support it.
#42

[eluser]Techie-Micheal[/eluser]
[quote author="louis w" date="1205278106"]But isn't the whole reason they are "ok" with CI is because it replaces them with long tags if the server does not support it.[/quote] Yes. But I think CI is the only framework (that I've seen) that does that. IMO, just for posterity they shouldn't be used. Who knows what CI will do down the road? That's all I'm saying. Smile
#43

[eluser]dtrenz[/eluser]
[quote author="louis w" date="1205277602"]Personally I'm not a big fan of if and endif. I prefer to enclose things in brackets, it helps to easily define a block of text. In fact I have hardly ever seen endif used until i started looking at these boards.[/quote]

i didn't use them much until I started using CI. when using views, it's sooo much cleaner. this is why Smarty uses the same syntax.

here is another article regarding this topic
#44

[eluser]Michael Wales[/eluser]
Well, since we're no longer talking about template engines.

My vote goes to:

Code:
<h1>&lt;?= $page_title; ?&gt;</h1>

&lt;?
if ($logged_in) {
    echo '<p>Welcome back, '. $username .'</p>';
}
?&gt;

Does anyone else hate it when they see braces on separate lines? I must be OCD or something but I will literally waste hours of my time "correcting" code that appears as follows. I know what the EE style guide say - screw them, I hate, hate, hate, hate braces on new lines. I can't even function when they exist - I literally can not read the code.

Code:
if ($this->uri->segment(3) !== FALSE)
{
  redirect('');
} else {
  redirect('omgdie');
}

</rant>
#45

[eluser]louis w[/eluser]
100% Agree. I hate brackets on new lines too. GROSS GROSS GROSS.

I think everyone on the boards does it just because thats how CI was written.

I second your vote too, I would use an echo instead of a ton of extra &lt;?'s



[quote author="Michael Wales" date="1205282506"]Well, since we're no longer talking about template engines.

My vote goes to:

Code:
<h1>&lt;?= $page_title; ?&gt;</h1>

&lt;?
if ($logged_in) {
    echo '<p>Welcome back, '. $username .'</p>';
}
?&gt;

Does anyone else hate it when they see braces on separate lines? I must be OCD or something but I will literally waste hours of my time "correcting" code that appears as follows. I know what the EE style guide say - screw them, I hate, hate, hate, hate braces on new lines. I can't even function when they exist - I literally can not read the code.

Code:
if ($this->uri->segment(3) !== FALSE)
{
  redirect('');
} else {
  redirect('omgdie');
}

</rant>[/quote]
#46

[eluser]wiredesignz[/eluser]
If CI has to replace short tags with full php tags, You may as well be using the Parser instead. I'm sure it would be just as fast to insert a value into the template as rewriting the php tags.
#47

[eluser]dtrenz[/eluser]
i can't code without nl braces anymore. i took up the habit. it really helps me visually sort out code blocks, nearly as much as indenting does.
#48

[eluser]Techie-Micheal[/eluser]
[quote author="Michael Wales" date="1205282506"]Well, since we're no longer talking about template engines.

My vote goes to:

Code:
<h1>&lt;?= $page_title; ?&gt;</h1>

&lt;?
if ($logged_in) {
    echo '<p>Welcome back, '. $username .'</p>';
}
?&gt;

Does anyone else hate it when they see braces on separate lines? I must be OCD or something but I will literally waste hours of my time "correcting" code that appears as follows. I know what the EE style guide say - screw them, I hate, hate, hate, hate braces on new lines. I can't even function when they exist - I literally can not read the code.

Code:
if ($this->uri->segment(3) !== FALSE)
{
  redirect('');
} else {
  redirect('omgdie');
}

</rant>[/quote] I cannot stand it when they aren't on new lines. I have to go through and "correct" code when they aren't on new lines. I can't read code when they aren't on new lines. So I guess you wouldn't like reading my code and I wouldn't like reading yours. Tongue
#49

[eluser]DerekF[/eluser]
Personally, I'm a big fan of the PEAR coding standards for the most part. So, yeah, count me in those who hate the newline-brace-newline convention for conditions. :-)

However, I do like the newline-brace-newline convention for class and function definitions:

Code:
class Foo
{
    function bar($hello)
    {
        if ($hello) {
            echo 'Hello world';
        } else {
            echo 'Goodbye world';
        }
    }
}

Just seems a bit more readable that way.
#50

[eluser]Techie-Micheal[/eluser]
[quote author="DerekF" date="1205283625"]Personally, I'm a big fan of the PEAR coding standards for the most part. So, yeah, count me in those who hate the newline-brace-newline convention. :-)[/quote] I'm a fan of phpBB3 Coding Standards, for the most part.




Theme © iAndrew 2016 - Forum software by © MyBB