ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > N.A.N.Y. 2013

NANY 2013: Carbon - website / blogging framework [alpha]

<< < (3/7) > >>

wraith808:
So... technical question.  It looks like you did your MVC work from scratch?  Is that right?  Just curious... I've been looking at CodeIgniter because I did an MVVM framework almost from scratch (using parts of Unity and Prism), and didn't want to go through that again, but love the approach.

justice:
Yes the MVC work is from scratch but inspired by CodeIgniter, I have used that in the past and can recommend it.
In the past I have found it difficult to neatly organise a project like this in the CI MVC model so I thought if I start from scratch I understand the foundations better.

It's won't be as robust as CI but then it won't have several years of little tweaks that make it harder to understand what's going on. :)

I'm trying to keep a separation between the mvc code and the system behind it so that people can just focus on their site structure and how it is generated.

Basically a request gets routed by Carbon::router to an appropriate
Application controller (based on content types).
The content gets filled in by the system's DataModel class which is passed through the application's Model (defines sections of content mostly). Once we have the content in the right structure it's sent to the application's View class that uses a very simple templater to generate the page.

Only using two models at the moment:

--- --- public static $page_model = array(
'markdown|html' => 'content',
);

public static $post_model = array(
'yaml' => 'metadata',
'markdown|html' => 'content',
);

I'm taking the controller and model that is used and then use that to choose the right template file (pages.php for pages, archive.php for archive etc).

But for example you might add a Portfolio controller and model that sends things through to a portfolio.php template.

wraith808:
That's really cool!  Having done my own framework, I know how much work is involved, and tip my hat to you- the code looks really solid for this stage of the game.  And if you're not using it for a wide variety of projects, having your own tailor made to what you need is great.  That's my problem with Unity and Prism and all of the Microsoft Enterprise libraries- they're too heavyweight.  Yours is functional and readable.

Great work!

justice:
Just tagged 0.2.1.
I've rewritten the framework using instances instead of static classes, which will help to implement unit tests where required in the future.
I've also managed to simplify the code in the process, it should be much easier to understand now:

Posts are listed in the index page. Pages contain a section of YAML followed by Markdown, by default.
Pages just contain markdown content, by default. In the _basic_ theme, pages are linked from the footer.
Configuration settings override the defaults.
Manage your data models and theming logic using the MVC classes in the _public/application_ folder.


Request object:

-   Cache
-   Log
-   Environment
-   Security
-   Controller
   -   Records
   -   Model
   -   View


Controllers (based on path, created uniquely for site):

-   Home (posts) default homepage
-   Admin (no model) administration section
-   Archive (posts) post archive
-   Errors (page) custom error pages
-   Feeds (posts) feed of posts
-   Images (file) content images
-   Pages (page) individual pages
-   Posts (post) individual posts


Model types:

-   File (present bare file)
-   Page (structure for pages)
-   Post (structure for posts)


View types:

-   Html (templated content)
-   Feed (xml representation)
-   File (download)

justice:
Carbon now has a website. You can see what i'm planning for upcoming milesones. There's a wiki for tutorials / carbon powered sites. You can discuss Carbon via IRC (#carbonframework on freenode) and Google groups.

Feedback request: Being so directly involved, I'd love to know, if you have checked out Carbon but gave up, at what point that was so that I can focus my time on making it accessible.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version