php-pds / skeleton

Standard PHP package skeleton.
Creative Commons Attribution Share Alike 4.0 International
2.3k stars 167 forks source link

Templates / Views folder #15

Closed RalfEggert closed 7 years ago

RalfEggert commented 7 years ago

I know that not every application needs templates or views. So it shouldn't be a MUST. But I would prefer a suggestion how to name such a folder because I have seen so many different names in the wild.

pmjones commented 7 years ago

I have seen so many different names in the wild.

Brother, you are singing my song. You can see them in the research, too.

But here's the problem: this is intended as a general-purpose skeleton, appropriate for all types of packages. Templates/views are generally in the realm of MVC-style packages. Those kinds of packages generally have very specific rules based on the kind of MVC system they are intended for. The parent systems have widely divergent rules on where to place stuff.

Further, once we venture into that territory, the next obvious step is to specify "models" and "controllers" and "entities" etc. And that, in turn, will preclude other structures that have even a little bit of overlap with to MVC.

I just do not want to open that can of worms. You get where I'm coming from there?

svpernova09 commented 7 years ago

Agree 100% but I feel like there should be some recommendation. Maybe "Templates or Views SHOULD be placed in a subdirectory of /resources"? Which may mean we define a package SHOULD have a /resources folder.

In my 100% unscientific recollection I'm more inclined to reach for a resources folder in the top level if I don't see a views or templates

Edit: hah! I didn't get far enough down the issues #12

pmjones commented 7 years ago

@svpernova09:

I didn't get far enough down the issues

Heh, yeah.

So, the thing here is that these directories (templates, resources, whatever) are not forbidden. It's just that the research doesn't seem to provide enough support to require that they have a standard name.

svpernova09 commented 7 years ago

So, the thing here is that these directories (templates, resources, whatever) are not forbidden. It's just that the research doesn't seem to provide enough support to require that they have a standard name.

Yes, that's fine. I'm suggesting we implement something (Probably as part of #12) that includes these folders SHOULD reside in /resources. IMHO this is also where your source JS and CSS/LESS files would live. If we should discuss this in #12 that's perfectly fine. not trying to derail this discussion.

RalfEggert commented 7 years ago

I just do not want to open that can of worms. You get where I'm coming from there?

Yup, I understand that. Nevertheless some recommendations for these kind of folders would be really nice.

pmjones commented 7 years ago

Nevertheless some recommendations for these kind of folders would be really nice.

Yes, it would be. I'm not sure this is the place for it, though. Perhaps on a later iteration, or in a separate publication.

pmjones commented 7 years ago

Any further thoughts on this? I am leaning toward closing it as "too specific to particular kinds of packages" (as vs being applicable to any kind of package).

pmjones commented 7 years ago

@svpernova09

I'm more inclined to reach for a resources folder in the top level

A resources/ directory has been identified for explicit inclusion in the standard as part of a 5th pass on the research. Cf #12 and https://github.com/php-pds/skeleton_research/blob/1.x/results/05-dirs.txt

pmjones commented 7 years ago

Closing this as "too specific to particular kinds of packages."