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

[eluser]matyhaty[/eluser]
Hi All

Firstly I would like to say there is some great Docs on CI, and has got me from no where to somewhere quite quickly.

I would love to hear some opinions on what we are about to embark on here.

We are making a new 'model' which will be at first a CMS, but will grow to encorporate Ecommerce, and any other aspect the company will need. The current models are poor and well out of date and hence we start with a screen slate.

Obviously we have choosen CI for our framework. The reasons are many, but the good doc, lightweight (varying levels of developer here) and new-ness of a php framework make this a great starting point.

The one major aspect this company excels on is great front end usability. The front end design (the site itself) is good, and hence we are not particually worried about it. Im focusing on the user administration area, which is where we fall down.....

Obviously we want to feature in features such as
- JQUERY and JQUERY UI
- AJAX
- YIELDS (for the front and back end, so we can have a standard markup for the CSS designers to utlisie for individual designs
to help us achieve what we are looking for.

Right, enough of the blabble, here is my current problem, which Im a little unsure of....

Our admin backend, will use columns, to display items. So you click one link, and it loads another column via AJAX on screen with the next set of options.... Simple enough....

It would be nice if each 'column' was a controller, and hence loaded in a master template for this column, and views etc. (yields or similar)

Is this
- possible?
- Sensible
- how best to layout the code. I was thinking, for example on the views folder, just to have folder structure here which would be logical to what they apply to
- http://blufusion.net/2009/07/30/easy-aja...deigniter/ is that a good example (Ive seen a lot of jquery and ajax examples which are very different

Below is a typical controller, from what I see the great strength in CI.

Sorry for long post, but I would dearly love to hear comments coming back (however good or bad!)

Many Thanks

Matt



--- Controller ----
Code:
<?php
class Contactus extends Controller {
  
   function Contactus()
   {
      parent::Controller();
   }
  
   function index()
   {
            // -----------------------------------------------------------------------------
            // Javascript loads
            // - remember for every page takes time, load what you need!
            // -----------------------------------------------------------------------------
            $this->load->Model('Javascript');
            $this->Javascript->setJavascriptHeaders();
            $this->Javascript->setJavascriptFileInclude('js/jquery-ui.min.js');
            $this->Javascript->setJavascriptFileInclude('js/contactForm.js');
            $this->Javascript->setJavascriptTinyMCE();
            $headers_javascript = $this->Javascript->getJavascriptHeaders();
            $this->template->write('header_javascript', $headers_javascript);
            // -----------------------------------------------------------------------------
            // End Javascript Loads
            // -----------------------------------------------------------------------------
          
          
            // -----------------------------------------------------------------------------
            // Header Stuff (Title, CSS and SEO
            // - css only load the files you need, keep it light!
            // -----------------------------------------------------------------------------
            $this->load->Model('Pageheader');
            $this->Pageheader->setPageTitle("This is our contact page");
            $this->template->write('header_title', $this->Pageheader->getPageTitle());
            $this->Pageheader->setKeyword("Bespoke");
            $this->Pageheader->setKeyword("s3d designs");
            $this->template->write('header_keywords', $this->Pageheader->getKeywords());
                      
            $this->load->Model('Css');
            $this->Css->setCssHeaders();
            $this->Css->setCssFileInclude('css/smoothness/jquery-ui-1.7.2.custom.css');
            $headers_css = $this->Css->getCssHeaders();
            $this->template->write('header_css', $headers_css);
            // -----------------------------------------------------------------------------
            // End Header
            // -----------------------------------------------------------------------------
          
            // -----------------------------------------------------------------------------
            // The Page
            // -----------------------------------------------------------------------------
            $data['mainTitle'] = 'Please complete the below form:';
    $this->template->write_view('content', 'common/contactUsForm', $data);


            // Write to $sidebar
            $data['rightColumn'] = 'This is sidebar content sent from teh data array!';
    $this->template->write_view('rightColumn', 'common/rightColumn', $data);

    $data['leftColumn'] = 'This is the left Columns information in some form!';
    $this->template->write_view('leftColumn', 'common/leftColumn', $data);
    // -----------------------------------------------------------------------------
            // End The Page
            // -----------------------------------------------------------------------------
  
  
  
  
  
    // -----------------------------------------------------------------------------
            // Make the Page
            // -----------------------------------------------------------------------------
      $this->template->render();
    // -----------------------------------------------------------------------------
            // End Page (and file!)
            // -----------------------------------------------------------------------------
   }
  
}




Theme © iAndrew 2016 - Forum software by © MyBB