Welcome Guest, Not a member yet? Register   Sign In
Introduction to CodeIgniter 4 Blog Posts
#11

Just added a new link to an article talking about how you can work with HMVC/module-like functionality in your CI4 apps.
Reply
#12

(03-15-2016, 10:09 PM)kilishan Wrote: Just added a new link to an article talking about how you can work with HMVC/module-like functionality in your CI4 apps.

Good thread.
Perhaps you have to add and info about the Module configurations how they will merge with the main app. 
Routes are always a difficult thing to handle in app <> modules relation.
Best VPS Hosting : Digital Ocean
Reply
#13

(03-16-2016, 12:35 AM)sv3tli0 Wrote: Good thread.
Perhaps you have to add and info about the Module configurations how they will merge with the main app. 
Routes are always a difficult thing to handle in app <> modules relation.

I can't remember if it's mentioned in the articles or not, yet, but config files are simple classes. There's no more need a specialized config loader, so there's nothing special needed to load the config files in the rest of the app, just a simple $moduleConfig = new \Standard\Blog\Config\BlogConfig().

Routes must be handled manually. If you remember from the Routes article, routes can be mapped to namespaced classes, so a route might look like:

Code:
// Define a single route
$routes->add('blog', 'Standard\Blog\Controllers\BlogController::index');

// Map to the standard crud methods
$routes->resource('blog', ['namespace' => 'Standard\Blog\Controllers', 'websafe' => 1]);

// Or define routes within a group to minimize typing.
$routes->group('blog', function ($routes) {
   $routes->get('/', 'Blog::index');
   $routes->get('/(:id)', 'Blog::show/$1');
   $routes->post('/(:id)', 'Blog::update/$1');
}, ['namespace' => 'Standard\Blog\Controllers']);

The system won't scan through to find the routes files automatically, but you can create a routes file in your "module" and then load it manually in the main routes file. There's a section at the bottom of it that loads in the environment-specific routes file. You can load the file down there with standard includes.
Reply
#14

Hey guys, Work on the framework is still moving forward. I have just come to a close getting the database layer basics, along with the Query Builder, in place. Whew! Still more to do before a first pre-alpha release, but we're inching closer. I've ask @kenjis to help out getting the testing layer into shape and ensure that the framework, and your applications, will be easy to test, and he's gotten a good start on that.

In the meantime, though, time for another preview article! This time, it's about the basics of working with the new database layer. Don't worry, it's not nearly as scary as you might think. Smile
Reply
#15

CI4 is too old-school. Let's see some CI5 (http://forum.codeigniter.com/thread-6484...30766.html) examples!!

Smile
Reply
#16

(04-01-2016, 01:02 PM)heat23 Wrote: CI4 is too old-school. Let's see some CI5 (http://forum.codeigniter.com/thread-6484...30766.html) examples!!

Smile

James was developing that version in secret, so I'm not sure how exactly to make the MRI work. Will have to get up to speed on it first. Smile
Reply
#17

Hey @kilishan,

Seems all nice !! I want to collaborate with my concerns:


Requests and Responses => Important to be alone, with all functionality (as symfony)

Content Negotiation => Ok, but as part of HTTP Request&Responses ... &Headers ??

Dependency Injection and Services => Needed, more clear !!

Routing => Great !!

Modules => Great, think about to have 'modules' as plugins... as would to be in packagist , anyone would publish modules and
collaborate in CI 4 with new additions.

Database Basics => Great !!


By the moment, not all CI <3 code will be trashed !!!


Thanks, CI 4 .... Welcome .
Reply
#18

Time for another preview article! Was going through docs last night on the current state of the database and realized a new addition to the framework that hadn't been mentioned anywhere - a lightweight HTTP client built into the framework.
Reply
#19

(04-18-2016, 07:34 AM)kilishan Wrote: Time for another preview article! Was going through docs last night on the current state of the database and realized a new addition to the framework that hadn't been mentioned anywhere - a lightweight HTTP client built into the framework.

What made you not want to include async into this client?
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply
#20

(This post was last modified: 04-18-2016, 11:04 AM by kilishan.)

(04-18-2016, 10:59 AM)albertleao Wrote: What made you not want to include async into this client?

Complexity. While I think async definitely has its place, and might be growing in popularity, it adds another layer of complexity to what we have to provide and support through promises, etc. And, thinking back, in my development career I've not once needed it. You can work around async needs using Queues or cronjobs.

Besides, this was intended to be a nice curl wrapper that solved the 80% use case, primarily, not a recreation of Guzzle. Smile
Reply




Theme © iAndrew 2016 - Forum software by © MyBB