Searching CakePHP pages

CakePHP framework comes with the default PagesController which is an awesome out of the box way to build a website of mostly static pages.  There is one rather annoying limitation though – no search option.  If you need a website of mostly static pages with search functionality, you are out of luck.  I spent a good chunk of time Googling (searching, eh?) for a solution and even talking to people in #cakephp IRC channel.  The best alternatives, it turned out are listed in this StackOverflow answer:

There is no built in way to search static pages as they are just files on disk.

You have three options

  • Build a model to hold the data somewhat like a CMS so you can use mysql search.
  • google search for sites
  • the more hacky approach of reading the contents of all the pages and using preg_match() or similar on the contents to find matches.

The first option is probably the best depending on your use case. The second option is the easiest if its public facing content. The third option is a horrible idea

Since I need the solution for a public facing website, it looks like I’m gonna go with Google Custom Search Engine option.

FormulaJS – JavaScript implementation of all functions supported by Microsoft Excel

FormulaJS – JavaScript implementation of all functions supported by Microsoft Excel

Voice Elements – web components for Web Speech API

Voice Elements – web components for Web Speech API

A couple of Web Components that can do amazing stuff like voice recognition (speech to text) and speech synthesis (text to speech) using the Web Speech API

RaphaĂ«l – JavaScript library for working with vector images

RaphaĂ«l – JavaScript library for working with vector images.

Raphaël is a small JavaScript library that should simplify your work with vector graphics on the web. If you want to create your own specific chart or image crop and rotate widget, for example, you can achieve it simply and easily with this library.

RaphaĂ«l [‘ræfeÉŞÉ™l] uses the SVG W3C Recommendation and VML as a base for creating graphics. This means every graphical object you create is also a DOM object, so you can attach JavaScript event handlers or modify them later. RaphaĂ«l’s goal is to provide an adapter that will make drawing vector art compatible cross-browser and easy.

Raphaël currently supports Firefox 3.0+, Safari 3.0+, Chrome 5.0+, Opera 9.5+ and Internet Explorer 6.0+.

vis.js – a visual interaction system

vis.js – a visual interaction system

Vis.js is a dynamic, browser based visualization library. The library is designed to be easy to use, to handle large amounts of dynamic data, and to enable manipulation of and interaction with the data. The library consists of the components DataSet, Timeline, and Graph.

The vis.js library is developed by Almende B.V, as part of CHAP. Vis.js runs fine on Chrome, Firefox, Opera, Safari, IE9+, and most mobile browsers (with full touch support).