My view appears twice |
[eluser]Plume[/eluser]
Hi people ! I'm not sure to be in the right forum. Not sure to understand correctly the title of each one. I'm taking control of CI. I'm using Layout Librairy ( http://codeigniter.com/wiki/layout_library/ ). And since I'm trying to organize controllers in different sub folders, I'm seeing my entire view appears twice. I mean the entire main layout, course What do you need ? Do you know what's my problem ? Thanks ! @tchaOo°
[eluser]Sumon[/eluser]
Best place to post your thread is http://codeigniter.com/wiki/layout_library/ page. Click "Start a discussion about this article!" and post your problem.
[eluser]Plume[/eluser]
I don't think so because I had this problem since I'm trying to organize my controllers in sub folder. The fact I'm using Layout Library was to informm you of all informations I thought good to tell you @tchaOo°
[eluser]Plume[/eluser]
Get the organization : ; I have a controller index.php, located in controller/home/, containing : Code: <?php Need something else ? I don't see the problem cause when I'm not organizing controller in sub folder, I don't have this one. So strange ! :o
[eluser]wiredesignz[/eluser]
It's pretty simple really. `index` is the constructor method and also the default method used by CI when running controllers. So your index() method is called during instantiation and again to run the controller. Index is also a reserved word, so don't use it to name controllers.
[eluser]xwero[/eluser]
Wiredesingz index doesn't appear in the reserved word list and i was under the impression methods are case sensitive. The router should pick up that the controller is named Index.
[eluser]wiredesignz[/eluser]
@xwero, the router has nothing to do with PHP object instantiation. And I have never seen any checks for object/method name clashes in CI. Methods are not case sensitive (under PHP5 at least), maybe you could check PHP4 Apologies if the word `index` doesn't appear in the reserved word list. Maybe it should.
[eluser]Dready[/eluser]
Hello, PHP class names are case-insensitive, no deal with CI. The index keyword should perhaps be added to the list of reserved words, but did you read controller documentation before starting coding your first controller ? The "index" thing is very well explained in there.
[eluser]Plume[/eluser]
[quote author="Yash" date="1222787551"]show me full code....[/quote] I would well but which one ? Quote:Hello,Yes, I read ( what is the preterit ? :/ ) And it worked when I don't organizing with sub folder. It's why I don't understand. @Wiredesingz : I'll try with some different named controller but, I never changed this during my first tests :/ Thanks for help folks ! I'll tell you what it will become |
Welcome Guest, Not a member yet? Register Sign In |