Bootstrap 3 + Codeigniter Form Builder - codeigniter

I was looking for a PHP, Codeigniter, Bootstrap 3 form builder and couldn't find one.

I couldn't find one that was satisfactory, so I've made one that I think is alright (and using in production now) It's located:
https://github.com/wallter/codeigniter_bootstrap_form_builder

Related

Simple html DOM parser on Laravel 8

I have controller, which worked on Laravel 5.2 and used library yangqi/Htmldom (based on simple HTML DOM parser). Now I need to make the same logic on Laravel 8 and I can't find a library, which is based on simple HTML dom parser and working on Laravel 8 (yangqi/Htmldom - not working with Laravel 8).
I have all the need for logic based on simple HTML dom and I don't want to make it again with another library (for example Goutte).
Maybe someone can help me connect a simple HTML dom parser to Laravel 8?
Problem was fixed to next steps:
We need to change one part of code in package yangqi/Html Dom, instruction here.
We need hyphen need to be escaped in all places like wrote here.

Laravel Pagination Foundation Compatibility

According to Laravel Documentation
In other frameworks, pagination can be very painful. Laravel makes it a breeze. Laravel can quickly generate an intelligent "range" of links based on the current page, and the generated HTML is compatible with the Bootstrap CSS framework.
My question is Foundation also compatible with Laravel's pagination?
There is nothing to stop Laravel pagination working with Foundation but the default HTML generated by Laravel is Bootstrap specific. There is no mention in the docs or API to suggest that it can generate Foundation-specific code.
You have two choices. One is to write your own custom code (covered elsewhere on Stack Overflow, although not specifically for Foundation)
The other option is to pull in a specific package that someone else has written:
Laravel 4
https://github.com/binarix/Laravel-Foundation-Pagination
Laravel 5
https://github.com/etcinit/foundation-pagination
You can easily pass the paginator data to your own view of a paginator. - Meaning you can do the following:
Create a folder named components in your views folder and then create a pagination view; after pass the pagination data to the component created and include it as shown below in any of your views.
Getting a paginated data set:
$yourPaginationData = App\YourModel::orderBy('id', 'desc')->with(['relation'])->paginate(15)
Including the pagination:
#include('components.pagination', ['paginator' => $yourPaginationData])
In the view, one can manipulate the pagination data as needed and create their own design and idea of pagination.
You can also find something open-source for foundation that was custom built to work with laravel here.

Symfony and AngularJS for Ajax: Angular-ify Symfony or Symfony-ify Angular?

When it comes to Ajax, it looks like Symfony (v. 2.7) and AngularJS (v. 1.4) don't go well together ;-)
I see two ways to make them cooperate - my question is: Which one is better?
Adapt AngularJS to be compatible with Symfony
Adapt Symfony to be compatible with AngularJS
For 1, this is the best instruction I found:
http://harmssite.com/2014/09/mixing-angular-and-symfony/
Advantage: Can use $form->handleRequest($request); in Symfony to get all form fields at once.
Disadvantage: Cannot set default value's for <input>'s, cause AngularJS overwrites them. Solution:
Set it in Angular's controller (i.e. in app.js). But if the value comes from the database (i.e. Symfony), how can you get it into app.js? Render the entire app.js file through Symfony's templating system? => Looks like overkill to me.
Set it inside the HTML/twig file with ng-init, as shown here:
AngularJS - Value attribute on an input text box is ignored when there is a ng-model used?
=> This is more a workaround than a solution ;-)
For 2, the major disadvantage is that you need to read each form field separately into Symfony, using $post = $this->getRequest()->getContent(); as shown here:
AngularsJS POST JSON data to Symfony2
I haven't tried this approach, so I don't know if there are further problems down the way ;-)
After fiddling around with this for a while, I finally came to a solution: Kick out AngularJS completely!
As far as I understand it now, AngularJS is only the way to go, if you are processing your forms completely (or at least mainly) on the client-side. I guess, that's what they mean by "Single Page Application (SPA)".
If you're using Symfony for form processing, AngularJS probably makes your life harder, not easier.
I'm now using plain jQuery for JavaScript, and everything works like a charm (including Ajax), much more hassle-free than AngularJS was.
If you just need to handle AJAX Requests from AngularJS to Symfony2 server, using classic forms (without Symfony2 form builder), you can use this bundle :
qandidate/symfony-json-request-transformer
Add it as a dependency in your composer.json and handle your requests (POST & other methods) in the same way as classic request.
You can See my post about this problem : Handling HTTP Requests from AngularJS to Symfony2
Other tip, to use AngularJS in your twig templates, add this in your angular app :
var app = angular.module('yourApp', [],
function($interpolateProvider){
$interpolateProvider.startSymbol('<%');
$interpolateProvider.endSymbol('%>');
});
This will change your start symbol from {{ to <% and your end symbol from }} to %>
In my case, use AngularJS make my work easier and me more productive, especially coupled to a Symfony back-end, but it's very personal, and depending on why/how angular is used.

What is the correct approach to learn Codeigniter?

In the last 3 months, i have learnt html, css, js and php and now i'm trying to learn Framework Codeigniter. My teacher gave me a rough idea abt MVC and asked me to download a project made on codeigniter from internet and edit it.
I downloaded a login form project and tried to read it. But i'm still kind of confused how everything works. i hv 2 questions:
What is the correct approach to learn codeigniter?
In how many days one can learn codeigniter? (i practice around 6-7 hrs a day)
The best way to learn codeigniter is to read the manual of codeigniter
Because, codeigniter framework is so much popular for their well formatted and clean documentation.
Or you can check this for beginner level tutorial
Or if you want to learn codeigniter by doing practical projects then you can follow this link
I learned CI over a weekend using this technique.
Start with simply setting up a 2 page site.
Home and About Us.
Pass simple string variables from the controllers to the views.
Next, bring a model into it.
Make a method in your model that returns some plain text, to the controller and finally to the model.
Next, make the model actually make a request to your database and return the result to the constructor then view.
After that try these:
write a helper function
Try making a basic route
Log a debugging message
upload a file from a form using the upload library
That's a good grounding in CI
Keep in mind Codeigniter is no longer in development also.
If your keen on sticking with PHP, you might want to check out the similar active project called "Laravel" after getting the hang of CIs very simple MVC structure.
Good luck!
the common way is read their manual and follow the guide, the another approach is search youtube for codeigniter turial, there are many good tutorial out there and easy to follow for example here is my result in the first place for keyword "codeigniter tutorial"
https://www.youtube.com/watch?v=BP9NRZXOvIw&list=PLIQyGVrcLTeXsq37O7IBGaUwu6xEwqBWV&index=1

Creating simple CRUD frontend component in joomla1.5

I am trying to convert a php application to joomla1.5 app. I have read some docs on how to create components in joomla1.5 but however i am lost at the best approach to create a simple CRUD frontend Component.
Here are my few questions
1) Should i perform my CRUD operations using JTable or simply use models and write my insert,update,select and delete scripts in the methods?
2) Where should this table class be placed if JTable
Thanks
Ok, first thing before you get too far is to upgrade to 2.5. There is no point in developing anything for software that is reaching end of life in about 60 days.
Next, anything dealing with the database should be put in the model. In Joomla it should be pretty straight forward, have you ready the MVC tutorial? Start with that, it should clear things up.
http://docs.joomla.org/Developing_a_Model-View-Controller_(MVC)_Component_for_Joomla!2.5
Yeah, forget Joomla 1.5 and then use this scaffolding tool

Resources