1

I have recently been asked to take over the administration of a website that is built on CakePHP 3.x.

I have never worked with CakePHP before. Everything I have read talks about using a command line interface, but I haven't done this since I was in Uni.

I discovered a Dashboard on the website where I can enter or edit the products, but I was wondering about the pages on the site.

I had to change some phone numbers in the footer of each page and it was only hunting through the files that I found src/Template/Element/footer.ctp and edited this.

Is there some way of editing the pages without finding the individual files?

Dave
  • 28,833
  • 23
  • 113
  • 183
  • It will depend on how it's the thing done. I recommend you first read about the framework and familiarize yourself. Otherwise it will all be a "hunting through" – yBrodsky Jan 24 '18 at 23:55
  • I think the short answer to this is going to be no. But like @yBrodsky said - once you learn about the framework (and this website's code in particular) there's a lot less guesswork. For instance, the path to the file you needed displays the obvious logic of how to get there (Template = how the page looks, Element = a particular part of the page, Footer = well, you get it :D) – HFBrowning Jan 25 '18 at 00:04

1 Answers1

1

No. What you're referring to (the command-line stuff) is for when you're baking files, running shell tasks, doing database migrations, installing things via composer, or using the built-in local server...etc. There are other uses too, but editing front-end files is not usually one of them.

Though there are methods for altering local files via command line, for the things you're talking about, like editing a footer, or other pages (.ctp "Template files" in Cake 3), it's standard practice to just do that manually.

See the standard path for template files in these examples:

src/Template/Users/profile.ctp
src/Template/Pages/contact.ctp
src/Template/Layout/default.ctp

A "layout" file usually fetches the header, content, and footer.

As you've found, there are also Elements, which are smaller chunks of code that are reusable across one or more Template files.

Dave
  • 28,833
  • 23
  • 113
  • 183