Hi wiredesignz
I got a big problem with HMVC partial view.
I create a module named ‘form’ have 3 controllers
and ‘test’ controller in application folder (Not in module)
form -> Display and setup form page
ckeditor -> Ckeditor (a RichText Editor) display
uploadify -> Uploadify (Flash base uploader) display
First ‘test’ controller load view named ‘test_view’
Here is ‘test_view’
<?php echo html_begin();?>
<?php echo display_form("testform");?>
<?php echo html_end();?>
html_begin() return HTML head content (Javascrip,css,meta etc.) and <body>
display_form() work only called Modules::run(“form/display”); to display form
html_end() return </body></html>
and then form/display load view named ‘formpage’
here is ‘formpage’
<?php echo $form_open;?>
<!--Begin validate errors-->
<?php for($i=0 ;$i < count($errormsgs); $i++):?>
<?php echo $errormsgs[$i];?>
<?php endfor;?>
<!--End validate errors-->
<!--Begin text input-->
<label><?php echo $form_normal_text_lb;?></label>
<?php if($form_normal_text_err):?>
<?php echo $form_normal_text_err;?>
<?php endif;?>
<input type='text' name='<?php echo $form_normal_text_nm;?>' value='<?php echo $form_normal_text_val;?>' <?php echo $form_normal_text_mod;?>/><br>
<!--End text input-->
<!--Begin richtext input-->
<label><?php echo $form_text_lb;?></label>
<?php if($form_text_err):?>
<?php echo $form_text_err;?>
<?php endif;?>
<?php echo ckeditor($form_text_nm,$form_text_val);?>
<!--End richtext input-->
<!--Begin checkbox input-->
<input type='checkbox' name='<?php echo $form_check_nm;?>' value='<?php echo $form_check_val;?>' <?php echo $form_check_mod;?>><?php echo $form_check_lb;?>
<!--End checkbox input-->
<!--Begin select selector-->
<label><?php echo $form_selector_lb;?></label>
<?php if($form_selector_err):?>
<?php echo $form_selector_err;?>
<?php endif;?>
<select name='<?php echo $form_selector_nm;?>' <?php echo $form_selector_mod;?>>
<?php foreach($form_selector_opt as $opt):?>
<option value='<?php echo $opt->value;?>' <?php echo $opt->flag;?>><?php echo $opt->label;?></option>
<?php endforeach;?>
</select>
<!--End select selector-->
<!--Begin flash uploader-->
<label><?php echo $form_file_lb;?></label>
<?php if($form_file_err):?>
<?php echo $form_file_err;?>
<?php endif;?>
<?php echo uploadify($form_file_nm);?>
<!--End flash uploader-->
<!--Display 'test_display'-->
<?php echo $test_display_lb;?> : <?php echo $test_display_val;?>
<input type='submit' value='<?php echo $submit_button;?>'>
<?php echo $form_close;?>
Now you can see
uploadify(); and ckeditor(); theses function just call Modules::run(“uploadify/display”); and Modules::run(“ckeditor/display”);
From the sample of code it should display like this(View source form browser)
<!---html_begin()-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
(Html header content,meta tag,script and css inclusion)
</head>
<body>
<!---html_begin()-->
<form ...>
(input tag and other HTML content for the form)
...
..
.
</form…>
<!---html_end()-->
</body>
</html>
<!---html_end()-->
But final output see like this..
<form ...>
(input tag and other HTML content for the form)
...
..
.
</form…>
<!---FROM html_begin()-->
<html>
<head>
(Html header content,meta tag,script and css inclusion)
</head>
<body>
<!---FROM html_begin()-->
<!---FROM html_end()-->
</body>
</html>
<!---FROM html_end()-->
I don’t know why and i search in forum but not found any thread about it.
I wonder problem may come from calling Modules::Run() in Modules::Run().
I mean first loading ‘test_view’ view cause Modules::Run(“form/display”) called
and then form/display load ‘formpage’ view cause Modules::Run(“ckeditor/display”) Modules::Run(“uploadify/display”)called finally both ckeditor/display and ckeditor/display
load its own view.
How to fix this problem. Please help me. :down: :down: :down:
Thank in advance!!!
PS. Sorry for my bad english. I’m Thai