News section - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Addins (https://forum.codeigniter.com/forumdisplay.php?fid=34) +--- Thread: News section (/showthread.php?tid=78401) |
News section - vojkoz - 01-14-2021 ParseError syntax error, unexpected 'public' (T_PUBLIC), expecting end of file APPPATH\Controllers\News.php at line 23 Code: 16 { RE: News section - captain-sensible - 01-14-2021 i can only see what you have posted but index method is missing a curly brace, above that it looks un complete could be: Code: public function index() RE: News section - vojkoz - 01-14-2021 (01-14-2021, 10:22 AM)captain-sensible Wrote: i can only see what you have posted but index method is missing a curly brace, above that it looks un complete could be: my code, this code from CodeIgniter4 User Guide PHP Code: <?php namespace App\Controllers; RE: News section - captain-sensible - 01-14-2021 (01-14-2021, 10:50 AM)vojkoz Wrote:now you are confusing me ; two methods both called Index ? you can't have that(01-14-2021, 10:22 AM)captain-sensible Wrote: i can only see what you have posted but index method is missing a curly brace, above that it looks un complete could be: RE: News section - InsiteFX - 01-14-2021 When your reading the tutorial you should update the index or other methods not add them in again. In other words you should replace the code or add the code to the method mentioned. RE: News section - iRedds - 01-15-2021 You are declaring a method outside the class RE: News section - nicojmb - 01-15-2021 You must replace the second index function with oldone, here an image explication: |