Method to store some site content data, allowing reusability

(Don’t believe this is a “best practice” question as I believe there will be a single better choice).

I need to choose a data storage option to store specific site data to allow easy management and re-usability: array; class; DB; Other; but am not sure which one would be adequate.

The data in question is my Services, which is a list of titles and descriptions.

Example of the text:

On-site SEO
We provide On and Off site SEO, by careful keyword assignment and placement,
blah etc, etc blah etc, etc blah etc, etc blah etc, etc blah etc, etc.

Logo Design
We can provide clean and elegant logos suited to your current company
branding… blah etc, etc blah etc, etc blah etc, etc blah etc, etc
blah etc, etc blah etc, etc blah etc, etc blah etc, etc blah etc, etc
blah etc, etc.

Each title is no more than 5 words, and descriptions are about 70 words/350 chars, and I have about 20 titles and descriptions.

As services can be changed, retracted, and new added, I want control over the data – more than just editing a view/template file where the raw output/HTML is done, because I:

  1. Require the data to be reusable on different templates
  2. Want the option to use only a part of each data, eg just the title(s) so a
    specific array index, or class method, DB table row, etc

I’m reluctant use an array, given the size of the Description text and number of services (20). And it might end up fiddly accessing a specific array value, having to know the exact key (the title), and the key being long.
I could use a multidimensional array, with the top level key being a simple reference, but it seems well overkill for the requirements.

It seems a waste of a class as the data itself is static, and feel I’d be abusing the point of OOP a bit.

I could use a DB, but the site doesn’t require a DB for anything else currently, though am happy to implement one if worthwhile for this.

The site is on a framework, loosely on MVC/P, so can implement anything easily.

So, out of the options: array; class; database; (other?) which would be the most suitable for this scenario?

The overhead difference is not an issue, as it’ll be marginal enough between all three for my requirements (small site, good hosting etc).

Access to said data will only be on a couple of pages, so having it in memory isn’t a large requirement (AFAIK).

3

Based on what you’ve defined – you want something thats more than variables in an included() file, but less than a database server – I’d look at keeping the information in an SQLite database. Thats a single file, server-less database system. I believe its built into PHP, so you wouldn’t have to install anything. And then if you ever need to scale up to something like MySQL, it shouldn’t require many changes.

7

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật