Welcome Guest, Not a member yet? Register   Sign In
Best CMS Structure
#1

[eluser]gvillavizar[/eluser]
Hello,

I have a project in CI and I was wondering the best CMS structure to work with.

So far I though of:

- Controller/admin/ (directory)
-> Controller/admin/real-controller (functions like add/edit/delete/list)
- Model
- Views/real_controller/ (directory with the name of the controller)
-> Add View
-> List View
-> Edit View
-> Other View

Is there a better way of doing this?
#2

[eluser]Yash[/eluser]
Ok try to look in my code -Blogmer
#3

[eluser]jedd[/eluser]
[quote author="gvillavizar" date="1237583826"]
I have a project in CI and I was wondering the best CMS structure to work with.
[/quote]

Hi gvillavizar .. you've asked quite a large question here!

Have you started to draw up the types of pages that you will want to present to the user? This will determine, to some degree, what structure you want. Do you want admin types to have a lot more power on every page, or should they be in a different 'part' of the CMS when they do admin stuff?

What kind of features are you anticipating? Are you going for a blog or wiki or a real CMS (the last can get quite huge).
#4

[eluser]gvillavizar[/eluser]
[quote author="jedd" date="1237590947"][quote author="gvillavizar" date="1237583826"]
I have a project in CI and I was wondering the best CMS structure to work with.
[/quote]

Hi gvillavizar .. you've asked quite a large question here!

Have you started to draw up the types of pages that you will want to present to the user? This will determine, to some degree, what structure you want. Do you want admin types to have a lot more power on every page, or should they be in a different 'part' of the CMS when they do admin stuff?

What kind of features are you anticipating? Are you going for a blog or wiki or a real CMS (the last can get quite huge).[/quote]

Hi jedd.

Basically what I want to know of the best possible file structure when working with a custom CMS.

So, lets say one of the features of the site is for users to have blogs, I already have a user structure but then i create some kind of module for blogs.

In my current style, I would have:

- controllers/admin/blogs.php
- controllers/blogs.php

- models/blogs_model.php

- views/blogs
-> views/blogs/list
-> views/blogs/add
-> views/blogs/edit
-> views/blogs/archives

And so on...basically what I want to hear is other people opinions on the structure they use when creating some kind of CMS.
#5

[eluser]Vicente Russo[/eluser]
I used to merge all views in one file, splitting views by a $state var... like $state='list', $state='add'. But now, I use one file per action, just like <b>gvillavizar</b>.. it`s more simple to deal with errors and finding the code you want.
#6

[eluser]isaaccreative[/eluser]
I usually have two main directories in my "Controller" directory. One for the front end title "default" and the other for the back end title "admin"

i.e.

Controllers
/default
../ news.php
../ blog.php

/admin
../ news.php
../ blog.php

And then the Views are set-up vary similar. I also use what I call a "loader" function in all my controller files. Everything first gets sent to the "loader" function and then use switch statements to activate all the other functions in the controller.


Recently I worked on an existing CI Project and the previous developer used HMVC. I must say it made my life 10 times easier. Basically it's a collection MVC's structures grouped per category.

i.e.

Modules /
/ News
../Controllers
../../deafault.php
../../admin.php
../Views (ect...)
../Models (ect...)

/ Blog
../Controllers
../../deafault.php
../../admin.php
../Views (ect...)
../Models (ect...)


The great thing about this structure is that each "section" is pretty much self contained. I'm considering switching to HMVC for all my new projects.
#7

[eluser]Julia Yan[/eluser]
[quote author="Yash" date="1237585974"]Ok try to look in my code -Blogmer[/quote]

Hi I try to install your blogmer, but have problem

install error
-----by auto
could not pass install because field must be not empty.
$db['default']['password'] = "";//I did not set password

------- by manual
After change config and database as request, first page error message

Deprecated: Assigning the return value of new by reference is deprecated in C:\EasyPHP5.3.0\www\blog\system\codeigniter\Common.php on line 123

Deprecated: Assigning the return value of new by reference is deprecated in C:\EasyPHP5.3.0\www\blog\system\codeigniter\Common.php on line 129

A PHP Error was encountered
Severity: 8192

Message: Function set_magic_quotes_runtime() is deprecated

Filename: codeigniter/CodeIgniter.php

Line Number: 60

So on...




Theme © iAndrew 2016 - Forum software by © MyBB