Mthaml composer package with Laravel 4 - Howto? - php

Original: Has anyone figured out, or is there anyone interested in helping me figure out how to use haml with Laravel 4?
Update: A fresh implementation of Laravel 4 using HAML(MtHaml) is being tested.
You can get it at my Github repo and test it out.
Note:
Mind that at this stage only the HAML/PHP engine is working, thus template inheritance is not yet working. For template inheritance to work MtHaml needs to be run through the HAML/Twig engine which then will give us all of Twigs Template Engines power and a really nice OOP-like syntax for our loops and such.
If anyone likes to help out with finishing the package to include Twig for a fully functional Template Engine feel free to Fork and Pull!! :D
Thank you.

Does it need to be any more complicated than using the Composer package?
https://github.com/arnaud-lb/MtHaml

I just created this because I wanted to get into HAML on a project. Let me know if it works for your needs: https://github.com/BKWLD/laravel-haml

I managed to get Laravel 4 working with dzony's implementation of Jade ( https://github.com/dz0ny/jade.php ) let me know if you are interested.
It does work with template inheritance using Blade Engine.

Related

Dynamically add or remove code module in a laravel project

I have been trying to understand how this concept works. Adding or removing code modules from laravel project. I have seen this feature in many places such as quickadminpanel.com, October CMS etc. These sites are used to create an admin panel quicker, there is an interesting feature that i found in quickadminpanel that is installing module that i need. Basically i want to achieve this but i don't know how to do !! May be someone can help as this feature and concept actually exists.
The author himself replied in a mail. Now the concept is much clear to me. He simply replied this, "It's similar to how Laravel works with stubs - copy-pasting files as templates, replacing the variables in content: youtube.com/watch?v=eWarTZuates&t=1s"

Zend Framework 2 + Doctrine 2 skeleton app

For some time now I'm playing with ZF2 and Doctrine 2 and I find them great.
I don't have much experience with either of them, but I've been looking into multiple tutorials and sample apps. They gave me some idea about the libraries, but I'm not feeling comfortable with things like DQL and flushing the EM in the controller. I realize ZF2 is still a beta, but I hope there is some piece of code that shows a scalable structure that can be the skeleton of a real life app.
Please share your experience and if possible provide sample source code.
Regards
Valentin
http://www.jasongrimes.org/2012/01/using-doctrine-2-in-zend-framework-2/ - nice tutorial all what you need to setup ZF2-D2
The skeleton is a skeleton of a real life app, that's what it is there for. If you want to hook up zf2 with doctrine, just install the DoctrineModule, and DoctrineORMModule (or ODM if that is what you want.)
DQL shouldn't really be in your controller, put it in a repository instead.
The EM can be flushed in your controller, but it can sometimes be better to set up an event listener, and then flush the EM once at the end of each request.

Working with PHPUnit and CodeIgniter 1.7.2

I recently started with the unit testing for my php website made in CodeIgniter 1.7.2. I want to test my web site using PHPUnit.
So I Googled it and came to know that there is a library for CodeIgniter & PHPUnit Bridge: http://www.foostack.com/foostack/. I have followed all the steps, and got the code running, but when I execute a test case from console, my default controller is executed and the html for the page is printed on the console.
Can any one please tell me what exactly is happening or am I doing something wrong? Also if any one has any other ideas to test the model without using the foostack library please suggest it. Please let me know if any other details are required.
Thanks in Advance.
CodeIgniter is not an ideal framework where you can unit test your code with PHPUnit. I have myself tried using FooStack once and was successful then, but it is too cumbersome. There is no way of testing a model isolated in CI because of the god object CI makes.
You can however try SimpleTest, here is a good library that can help you with it: https://github.com/ericbarnes/codeigniter-simpletest
Other than that there is the Unit Test library provided with CI - which in nowhere near a full unit testing framework, but does let you do basic assertions, reporting etc.
If you're really serious about unit testing, I'd suggest you move to frameworks that value this. My favorite is Zend Framework, but there are other good ones as well: Symfony, Kohana, Lithium, etc.

YII Pluggin for Net Beans

Can you please let me know where do I get YII Framework plugin for Netbeans? I tried to search but I couldn't find.
Thank you very much!
The question is why do you need a plugin?
Just include Yii framework path in your project include path and all your functions will be part of autocomplete.
I use Yii with netbeans all the time and never felt the need for one. However there is another IDE, codelobster, who recently launched a plugin for yii, you might check it out but it is not as good as netbeans for advanced users, however good enough for basic usage so you might be interested.
Also for PDT there is plugin adding yii framework support. At the moment functionality is limited to creating new yii-powered project and some useful navigation (controller/action -> view, view -> view (partial render), widget->widgetClass, and some others.
More information you can find at yiiclipse home page.
There isn't one currently. That's why you couldn't find it.
actually it is available here is the link
http://www.yiiframework.com/news/69/yii-plugin-for-netbeans/

Symfony tips & advices

I'm developing Code Igniter as framwork and i want to switch to Symfony but the problem is that I don't even know if I have bad habits with MVC or Framwork in general.
I know it's a quite subjective question, but I thought it could be a good idea to ask people who has already practice with this framework.
So if you have some Do's and Dont's about framworks in general or more accurately about Symfony I would be grateful !
Timon.
The Documentation on the Symfony website is all you need - its very extensive and will help you learn the framework quickly and in depth
Check your applications before deployment with list on http://symfony-check.org/
These are some tips:
Don't modify css/javascript codes from the web directory, you
must edit them in your src bundles, then assets:install, and
assetic:dump.
Never try to mix PHP and twig codes
Never edit the framework bundles (the vendors folder)
Use fixtures for your tests.
Try to avoid dependencies between bundles. Every bundle should be
independent of the others.

Categories