How To Show JSON Array Only In Recess PHP Controller

By default, Recess PHPs’s JsonView class responds with the properties of your controller. So even if you create a custom route that outputs only an array, a default row of the controller’s model will also be included with null values.

You can override this using the OKResponse class. You can do it like this.

How To Disable Caching When Using Chrome Developer Tools

Caching can be annoying especially when you are doing development work for a project. But in Google Chrome, there is a way for you to disable caching while the developer tools window is open.

Simple go to :

  • More tools
  • Choose Developer Tools
  • Click the wheel setting icon on the far right
  • Click the option Disable cache (while DevTools is open)

That’s it!

How To Use JQuery Input Mask With Angular JS Directive To Mask Date

Why bother with complexities when there are already libraries that mask date formats, right? The JQuery Input Mask library does the trick easily.

I do not like to use HTML 5’s Date input type field because you still would have to create a function to limit the number of characters for the year. There is no attribute in this HTML element to define the max length. It just does not work.

So rather than bother with hassles, this JQuery library does the trick easily. This is how the HTML input field will look like.

And here, is the Angular JS Directive code:

If you noticed, the reason I used a bind on the keyup function is because the JQuery Input Mask library messes the backspace and delete key result if I wanted to use scope.$parsers to detect any input. Binding the keyup did the trick.

Pretty easy, right?

Related Posts Plugin for WordPress, Blogger...