开发者

CodeIgniter - big site best practices

开发者 https://www.devze.com 2023-03-24 04:03 出处:网络
CodeIgniter + Template howto design a portal like behavior. I\'m not getting the concept of how to design bigger sites with CodeIgniter and Templates.

CodeIgniter + Template howto design a portal like behavior.

I'm not getting the concept of how to design bigger sites with CodeIgniter and Templates. The templates I'm using is Template Library for CodeIgniter. I'm having problems solving the following.

What I can see I need is some MasterTemplate that provides "MainRegion" for ProductCatalogue browsing and Account management etc. Then I would like to have a concept of "Widgets" loaded from the MasterTemplate that the user does not interact directly with instead it is simply informative. Ex: ShoppingCartWidget, TopNews etc...

Example of problems: A) Widget - A shopping cart widget exposes a minimalistic resume of what user has added when browsing the the product catalog in the "MainRegion". B) Hierachival view structure - When navigating to the "Account section" of the site the site renders a sub-view of the account system in the "MainRegion". My problem is that the state of the AccountSection is lost when I for example leave the "AccountSection" in to "ProductCatalogue" and the back to "Accountsection". I want to be able to render each subsection independtly smothly insterted into the "MainRegion" in the master template.

I really don't get the architecture. I need help to bring real modularity into the design.

I would开发者_如何学Python like to achive the following:

1) View fragments should render from a its own model. Ex: ShoppingCartWidget always reads its state from ShoppingCartModel. 3) View fragments should have a display[on/off] in some MasterTemplate concept. So that I can Ex: Start showing the ShoppingCartWidget when there is something in the ShoppingCart. (I don't want to render ''). 4) Stateful views. Ex: UserLoggedIn/UserNotLoggedIn

I'm missing the complex design principles for bigger sites or best practices for CI.

Very greatful for any help!

Thanks

Niclas


HMVC for Codeigniter does what you want: https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号