Rb Library Error in CodeIgniter 3

Tiempo de lectura: 2 minutos

Reading time: 2 minutes

Red Bean is a PHP library that facilitates the development of a CRUD (for example) in CodeIgniter 3. As you start using it, I will show you how it works and what it allows us to do.

Once you have configured the project as explained in Systematic Installation and Web Development of Red Bean + CodeIgniter 3 and Bootstrap, in the view folder (where the views are located), you will find the file welcome_message.php. Delete its content and add whatever you want to appear when running the application.

When you run it, you will encounter the following error:

Remember that in order to run it, you need to have Apache and MySQL services in XAMPP active!

This error indicates that in line 1512 of the file (Rb library), which is located in the path shown in the image where I have the project hosted, ParseError: syntax error, unexpected namespaced name ‘implements\IteratorAggregate’, expecting ‘{‘. This means that before the implements keyword in the indicated line, you need to add a space.

As you can see in the image, everything appears to be stuck together, which causes the error. All you need to do is add a space after ‘implements’ and before ‘\IteratorAggregate’, as shown in the following image:

Save the changes and run the project again. You will see that the error has been resolved, and the view is loaded without any issues with this library.

That’s all, I hope it helps you.

Leave a Comment