Whoever loves to work with Twig template system for their PHP driven web application may want to implement AngularJS within Twig template. But the main problem will be Twig’s curly braces. AngularJS and Twig both use __ inside their template to output data. So simply, it can cause trouble to work with this two lovely systems together in your application. But here is the solution. According to AngularJS $interpolateProvider docs I figured out the easy solution. You can change AngularJS …
Category: Programming
Read articles, tips & tutorials, news and updates on programming language. I write on mostly all languages and try to share my experience with you so you don’t need to spent too much time to find the solution by yourself. Sharing is the true power of knowledge.
This example will help you to learn how to interact between your backened RESTful apps and AngularJS. AngularJS has a service factory called ngResource which you can use to do CRUD operation with your RESTful backend application. Here you just need to define the service factory which will get all notes by calling an ajax request to your http://yourRESTAPIBackendserver.url/notes. Also you can do rest of the CRUD services with that script. This script represents very basic usage of ngResource. So …
Sometimes you need to see your variables or object in Twig template before printing it out. So to enable debug mode in twig template system you just need to tweak few settings upon initializing twig environment. Just follow the below code where I initiated Twig environment with debug mode. <?php $twig = new Twig_Environment($loader, array( 'debug' => true, // ... )); $twig->addExtension(new Twig_Extension_Debug()); And inside your template where you want to dump the variable just write “. You can …
Write configuration data in a .ini file in PHP. It’s important for large application to store global configurations about the whole/partial system for applications.
After lots of folk PHP5 has released [Zend OpCache] engine with core PHP5.5 and PHP internals will continue to develop PHP with this Zend OpCache in future releases of PHP. It’s great news for all the PHP lovers who used APC cache to boost their application performance. But keep in mind, APC is no more supported with PHP5.5 and may not be for future release also. So here you should love OpCache (original name: Zend OpCache) for tweaking your application …