I am using sulu minimal edition.
So i want to create bundle for my custom controllers.
I have contact form in my website.
On form submit i want redirect to symfony route.
Save data in custom table and display in admin area user role wise. Whats best way?
I follow http://blog.sulu.io/how-to-develop-a-bundle-in-the-sulu-admin-1
but php on ./bin/websiteconsole debug:router my new routes created in controller not showing.
Sounds like you use annotations. Dit you try defining your route with XML?
As far as I know annotation - and XML defined routes can't be mixed within the same bundle (some please correct me if I'm wrong). Since Sulu uses XML I'd stick to that for the sake of consistency.
Related
is there a way to send Symfony’s data from its action to Wordpress page?
For example Symfony’s action returns an array and in a Wordpress page I could iterate it?
Wordpress use template that are basic php file.
So you can make request to any rest api you want you using php. You can use your symfony rest api if you want.
Simply go in wordpress create pages and create template that will make your request to Symfony and display what you need.
It's really not recommanded but for a special case it could be possible.
You maybe should take the time to simply move your data in the wordpress DB.
I used sonataadmin and really like some features, like creating an entity and its related entity in the same page. I want to use it for frontend user also. Is it possable to use sonamaadmin for both backend and frontend users? Or is there another bundle allowing me to create an entity and its related entity in the same page?
Those are just form types, provided by the SonataAdminBundle. You can use them in any form.
You probably looking for the sonata_type_model or sonata_type_collection. See the documentation for more information.
Of course you can use Sonata Admin in both, although will be like only having a backend and made the correct security configuration for two kind of users. About entity and its related entities in the same page, that has nothing to do with Sonata, this can be achieved with symfony simple and embed forms.
I have installed FOSUserBundle. Now I would like to have two different templates for the same login action: one for the login in the layout and the other one for a standalone login page.
What is the way to do this?
You can leave the login form from FOSUserBundle as is (or overwrite it by moving it to app/Resources). This form will be used for the standalone login page. For other sections of the website you can create a new login form in twig yourself, the important thing is that your form will need to have all the fields named like the one from FOSUserBundle and to have the action path set to the login check page (because your using FOSUserBundle the path is "fos_user_security_check").
The names for the fields you will find here:
https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Resources/views/Security/login.html.twig
You can see that you need also a generated csrfToken. You can generate it in your controller, also inspired by the guys from FOSUserBundle: https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Controller/SecurityController.php#L43
I'm using Symfony2 and the FOSUserBundle to manage registration and logins. I'd like to add a captcha system. Is there are pre-existing bundle or tutorial on this?
Of course, I could try to roll my own using Google re-captcha. In that case, is Google reCaptcha a good choice, or should I use some other API?
There are indeed a bundles for that, take a look at:
CaptchaBundle
Or
EWZRecaptchaBundle
Both got (most likely) all the documentation you need added in the README.md file or extended documentation.
I just wrote a tiny bundle called caitcha-bundle.
According to this part of the fos user bundle documenation implementation should be quite easy because you only have to activate the caitcha bundle and add $builder->add('caitcha', 'caitcha'); to the form type.
Because captcha images and any other approaches that require some user interaction which is not related to the form itself are very annoying in my optinion, I tried to implement an invisible bot protection by using the honeypot method and a check for the time it took to fill in the form. It works well for my use cases but still has to be extended by more checks I suppose. I would appreciate any suggestions to improve this bundle.
I just started studying Drupal 7 and learned how powerful CCK and Views are. But it still confuses me a bit because it behaves so differently compared to Wordpress. Now I want to build registration form, is it appropriate to build it using CCK? If so, how do I make it so it would make the login system aware that a new user has registered? Or would it be better and easier to modify the built-in registration system to my liking?
A registration form for... what exactly? The site? An event? RSVP? If this is just to register and post comments or blog articles, then use the core login system- thats what it's there for. You can add fields to this form by enabling Profile module and adding fields to capture more data about the user.