How to Create Web Stories with CodeIgniter

How to Create Web Stories with CodeIgniter
How to Create Web Stories with CodeIgniter

How to Create Web Stories with CodeIgniter

  1. Create a new CodeIgniter 3 project.
  2. Create a new folder called "webstories" in the "application" folder.
  3. Create a new file called "index.php" in the "webstories" folder.
  4. In the "index.php" file, add the following code:

PHP
<?php defined('BASEPATH') OR exit('No direct script access allowed'); 
class WebStories extends CI_Controller 
{ 
public function index() 
{ 
$this->load->library('webstories'); 
$this->webstories->generate('my-story'); 
} 
}

  1. In the config.php file, add the following code to the modules array:

PHP
$config['modules']['webstories'] = [ 'path' => APPPATH . 'modules/webstories', ];

  1. Save the config.php file.
  2. Run the following command in the command line to generate your web story:

php spark generate:webstory my-story

  1. Open the my-story.webstory.json file in a text editor.
  2. Edit the my-story.webstory.json file to add your content.
  3. Save the my-story.webstory.json file.
  4. You can now view your web story by opening the my-story.webstory.html file in your web browser.

Here is an example of a my-story.webstory.json file:

JSON

This code will create a web story with two slides. The first slide will have the title "Slide 1", the image "image1.jpg", and the content "This is the content of slide 1." The second slide will have the title "Slide 2", the image "image2.jpg", and the content "This is the content of slide 2."

Web story:

#webstories, #codeigniter,#seo, #storytelling, #visual storytelling, #amp,#mobile-friendly, #interactive