Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
FullmetalPride
I don't like HTML in my class files, actually. Makes them rather large. Plus I'm already having to write php inside the templates to use those functions, so why add those in the first place? And once I do that I end up having to use ob's to profess the functions.
Jonteh, you use ob_get_contents all the time. You used it in UberCMS and I believe illuminia.
I didn't code the original UberCMS, Meth0d/GraphiX/Roy did. I just made edits and then when I was good enough I coded Illumina without ob_get_contents. If it's in there, then I would have put it there when I was a newb not having any idea what it did.
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
Jonteh
I didn't code the original UberCMS, Meth0d/GraphiX/Roy did. I just made edits and then when I was good enough I coded Illumina without ob_get_contents. If it's in there, then I would have put it there when I was a newb not having any idea what it did.
It's extremely useful. I used it cause rev used it and people seem to like rev.
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
FullmetalPride
It's extremely useful. I used it cause rev used it and people seem to like rev.
Rev is a horrible CMS. You should be writing it how you like it, making it as user friendly as possible. I don't find PHP inside templates clean or user friendly, but whatever floats your boat =p
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
Jonteh
Rev is a horrible CMS. You should be writing it how you like it, making it as user friendly as possible. I don't find PHP inside templates clean or user friendly, but whatever floats your boat =p
It's a lot better than sticking random functions in here and there.
I dunno if you noticed but all the CMSs that become popular use php in templates. I'm not saying I'm doing this for popularity but it's obvious that's the way that people like it written, and I'm also fairly comfortable writing it like that so, why not.
I'll probably stack and consolidate the larger chunks of php into functions. For now they'll remain where they are.
Before i hit the sack, I'm committing my changes.
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
FullmetalPride
It's a lot better than sticking random functions in here and there.
I dunno if you noticed but all the CMSs that become popular use php in templates. I'm not saying I'm doing this for popularity but it's obvious that's the way that people like it written, and I'm also fairly comfortable writing it like that so, why not.
I'll probably stack and consolidate the larger chunks of php into functions. For now they'll remain where they are.
Before i hit the sack, I'm committing my changes.
Have you also noticed the amount of help threads regarding Uber and Rev? If you're aiming to advance your skills rather than creating a popular CMS. then you should be practicing better PHP.
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
Jonteh
Have you also noticed the amount of help threads regarding Uber and Rev? If you're aiming to advance your skills rather than creating a popular CMS. then you should be practicing better PHP.
Thats usually due to the amount of edits and renames that errors pop up and people get scared thinking they can get hacked and what not. A CMS should work out of the box and be dummy proof.
Re: [PHP] WindPHP: "Whistler" [R26]
I use PHP inside my template file, I used to use a templlate engine when I got sick of that. Php is still the best way to make your template dynamic not a crappy new syntax that needs to be parsed php again. Also, using php inside templates isn't bad, it's just how you use it. Don't put logic in there, only things what matters when you print your variables on the page.
Also what Jonteh says about the ob_ functions, you actually don't need it, require would be enough as it includes and executes all the php, just do it every thing in de right order!
But please don't look at ubers template class, it could be done allot better!
And remember, every single file can be done better. Nothing is perfect. It's just, keep it as clean as possible.
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
Joopie
I use PHP inside my template file, I used to use a templlate engine when I got sick of that. Php is still the best way to make your template dynamic not a crappy new syntax that needs to be parsed php again. Also, using php inside templates isn't bad, it's just how you use it. Don't put logic in there, only things what matters when you print your variables on the page.
Also what Jonteh says about the ob_ functions, you actually don't need it, require would be enough as it includes and executes all the php, just do it every thing in de right order!
But please don't look at ubers template class, it could be done allot better!
And remember, every single file can be done better. Nothing is perfect. It's just, keep it as clean as possible.
Using require doesn't allow me to use params.
For the most part, uber and rev's template class Is exactly the same. What's the problem, yo
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
FullmetalPride
Using require doesn't allow me to use params.
For the most part, uber and rev's template class Is exactly the same. What's the problem, yo
When you have this in a function/method
PHP Code:
$page = $this->model;
// include tpl file
require $file;
When you require your template file, it will include that file in that function. What you eventually get is that in your template file you can use the "$page" variable which for me, stores all the variables I need for that page.
A line within my template file:
PHP Code:
<title><?php echo $page->GetSitename() . ' - ' . $page->GetLanguage()->Get('INDEX_SITE_TITLE'); ?> </title>
You dont need a overkill "str_replace" to use variables in you html file!
I'm not saying you SHOULD now change your whole cms just because of a random quy (me) motivating why he uses this method. It's just to let you see, it could be done diffrently.
As for Uber and Rev, they're both outdated.
[PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
Joopie
When you have this in a function/method
PHP Code:
$page = $this->model;
// include tpl file
require $file;
When you require your template file, it will include that file in that function. What you eventually get is that in your template file you can use the "$page" variable which for me, stores all the variables I need for that page.
A line within my template file:
You dont need a overkill "str_replace" to use variables in you html file!
I'm not saying you SHOULD now change your whole cms just because of a random quy (me) motivating why he uses this method. It's just to let you see, it could be done diffrently.
As for Uber and Rev, they're both outdated.
Yeah I see your point.
Doesn't all those php opening tags wear down the php engine though? I've always thought this.
Granted rev and uber are outdated, but your method is the same as holo's
Re: [PHP] WindPHP: "Whistler" [R26]
Don't you just love that logo?
I'm going to try and finish the me page so I can get started on getting the headers and tabs to work.
Re: [PHP] WindPHP: "Whistler" [R26]
I has question...
Are you planning on providing support not only for IIS, but for Apache, Nginx and so on?
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
ησвяαιη
I has question...
Are you planning on providing support not only for IIS, but for Apache, Nginx and so on?
Absolutely!
I only typed the IIS path for debugging purposes.
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
FullmetalPride
Absolutely!
I only typed the IIS path for debugging purposes.
And don't just use a generator on the internet, they are pretty terrible at converting them.
Re: [PHP] WindPHP: "Whistler" [R26]
Quote:
Originally Posted by
ησвяαιη
And don't just use a generator on the internet, they are pretty terrible at converting them.
Right, about the .htaccess.
Well I dunno how to write them manually. Web.config is much easier to write.