Welcome Guest, Not a member yet? Register   Sign In
how can i integrate layout and modular extensions??
#1

[eluser]Unknown[/eluser]
i have integrate modular extensions in my application. now i need to add a layout system in my application.
i m working on it..
bt can anyone provide me any solution regarding this....
can i have any library ?
wht will be the best soultion?
plz help me
#2

[eluser]Dready[/eluser]
Hello,

did you look at this thread ?
#3

[eluser]Phil Sturgeon[/eluser]
Here is the latest from my Layout Library which is designed to work with matchbox (default configuration) or to use subdirs/normal CI layout instead.

Might look a little crazy, but the basics are:

Code:
$this->layout->title('Whatever'); // Sets the page title

$this->layout->create('view', $data); // Loads view.php from your current module view folder

The rest of it is for guessing breadcrumbs, guessing titles based on modules/controllers/etc which you may not need.


An example layout file can be the following:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html &gt;
&lt;head&gt;
    &lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
    &lt;title&gt;&lt;?=$page_title;?&gt;&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;

<div id="header">
    <h1>Site name.com</h1>
    <h2>Slogan...</h2>
</div>

<div id="content">

    <div id="left-column" class="sidebar">
        
        <div id="navigation">
            <ul>
            <li>Home</li>
            <li>About</li>
            <li>Other</li>        
        </div>

    </div>


    <div id="right-column">

    &lt;?=$page_output; ?&gt;

    </div>
</div>

<p id="footer">Made by Rick Waller</p>

&lt;/body&gt;
&lt;/html&gt;

Page title will show your manually set page title, or make a good guess based on odule and controller.

Page output will be the content of the view file you passed it.

Also handy stuff:

Code:
$this->layout->wrap_mode(FALSE); // Will just output the view file, without this wrapper file

$this->layout->html_mode(FALSE);
$this->layout->create('<b>Hello!</b>'); // This makes the output body just a bold hello, and will still give you your title, your breadcrumbs, etc.


Its not perfect and needs documenting, but should help. ^_^




Theme © iAndrew 2016 - Forum software by © MyBB