We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Please share how was your learning curve with Phalcon

Hello everyone! I'm planning to write some quick recipes for common tasks that you may encounter while developing a modern web app with Phalcon; by recipes I mean tutorials like the one about how to implement a blameable behavior in your models or even something more complex like writing an entire RESTful web service with the framework. However I'll try to make them more detailed on how the whole thing works and point out some cool combinations or techniques that one may be able to figure out by themselves only after a long period working with the framework.


TL;DR

I just want that you guys point me out some trivial tasks, that you didn't find so easy to implement or integrate in your apps; be it by a eventual lack of details in the documentation or just some concept that you wasn't familiar with. Anything you remember from the early phases of your learning curve of this framework will help me to choose which recipes to write.

Thanks to any help (:



26.3k
  1. How to switch off Phalcon's default notNullValidators? They have user unfriendly default's messages. In order to provide my own messages for PresenceOf validator:

//in a model

public function initialize(){

  $this->setup(
    array('notNullValidations'=>false)
  );

}


26.3k
edited Sep '14

2 Tutorial how to build your own validators e.g. own validator for checking if a provided phone number is valid for choosen country of registration. There are some mistakes in the API how to implement it. Pay attantion on the fact that form validators and model validators are not the same.



26.3k

3 How to set up a router that is working completly as sb want it to. I mean with all defaults routes settings, removing extra slashes, capable of what to do when the route is not found, for multimodule aplication.

4 A tutorial how to handle Exceptions and errors in Phalcon in a proper way (best practicies). E.g. logging exceptions and notifiyng dev by e-mail/SMS. How to configure a production and development enviroment in terms of exceptions/errors.

5 Implementation of model-service-layer in Phalcon for a complex web application. Extending the repo https://github.com/phalcon/mvc/tree/master/multiple-service-layer-model to the level that this repo actually do some real operations. Good idea would be togather with RESTful module.

My experience: I have only a year of experience in PHP (from zero but was learing a lot day to day) before starting working with Phalcon in march this year. This is my first framework. A person that had lot of experience with PHP general and other frameworks may have other problems when switching to phalcon (or what I belive zero problems at all).

@Conradaek some wonderful ideas here, thank you for participating!



15.1k

6. Forms, form builders etc. How to create and handle forms. How to render them, both manually and via volt. How to get the data out of them and how to link them with models.

7. Advanced usage of dev tools. Models - setters-getters, namespaces. Migrations etc.

8. Caching - view / data / metadata

)

edited Sep '14

@nazwa I didn't remembered about those ones:

  • Integrating forms with models
  • Migrations

Good catch, thanks!