Using Viewi and CI4 |
I recently came across Viewi https://viewi.net/ A package to add interactivity to an app using PHP. It's similar to Laravel's Livewire. I gave it a go and try to see if it will work with CI4. I got the pages to render but i noticed the Viewi routes are overiding CI routes depending on which one is intialized first in public/index.php.
PHP Code: /* PHP Code: app/Config/Routes.php copied from @InsiteFX answer, this was working for me so suggesting ya too.
Learning Codeigniter
(08-22-2022, 07:29 AM)SubrataJ Wrote:This is for loading routes from different modules it doesn't solve my issue.
I created CodeIgniter4 Viewi Demo:
https://github.com/kenjis/ci4-viewi-demo
I've update the adapter:
https://github.com/kenjis/ci4-viewi-demo And created another sample code for the Viewi's tutorial: https://github.com/kenjis/ci4-viewi-tour-of-heroes
CodeIgniter 4 Integration | Viewi
https://viewi.net/docs/integrations-code-igniter4
Hi,
I was looking for an integration of Laravel Livewire into CI4 and then i found "Viewi". I was so excited that we could do the same with CI4. Then came the damper to my excitement. I went through @kenjis 's documentation on Viewi integration and realized i, being not a high techie, had to do underhood hacking to do get this working. Especially when taking about the Response class. This para instantly knocked my off my chair "By default, Response object keeps data as a string (html or json encoded). But you need to pass an original data, for example, if your API returns a BlogPostModel, you do not want to receive a json object instead of a fully typed instance of BlogPostModel class." Going further down the documentation it got worse. I realised it was not so straight forward. All i want, as a business developer using CI4, are to Install the Viewi and use the features in delivering the contents and reactively update page components very similar to Vuejs. Is there such a thing, please?
https://github.com/lonnieezell/cellular
This was also a good thing, but I don't think it is usable at this stage.
(08-27-2023, 12:33 AM)datamweb Wrote: https://github.com/lonnieezell/cellular Unfortunate, the creators appears to have gone dormant too. |
Welcome Guest, Not a member yet? Register Sign In |