• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
calender()

#1
Hello,

I have a question about codeigniter 3.x -->  I am reading the description there are calender( ) and tablesorter( ).

I wonder why there are no manuals on how to use the function ?

http://www.codeigniter.com/user_guide/li....html#id22

Is it still under construction ?

When will it be launch ?  Am I able to request new features if I need it ? 

Has codeigniter 3.x be stable ?  What version is underconstruction ?  3.x or 4.0 ?

Thanks in advance.
" If I looks more intelligence please increase my reputation."
Reply

#2
You are not reading the description carefully enough.
At the top of the Javascript library writeup that you mention, there is a prominent notice:

Important
This library is DEPRECATED and should not be used. It has always been with an ‘experimental’ status and is now no longer supported. Currently only kept for backwards compatibility.

The library will be removed in an upcoming version of CodeIgniter.

CodeIgniter 3.x *is* stable, currently up to version 3.0.6.
CodeIgniter 4.x is under development.
Reply

#3
What about the calendering class: ?

http://www.codeigniter.com/user_guide/li...light=date


I try this:

views/blog_form.php


PHP Code:
<html>

<
title>Blog Form</title>

<
br>

<
h1>BLOG FORM</h1>


<?
php $this->load->helper('form'); ?> 
<?php $this->load->library('calendar');  ?>

<?php echo validation_errors(); ?>

<?php echo form_open('form'); ?>


<table>

<tr>
<td>Date  :</td>
<td><?php echo $this->calendar->generate();  ?></td>
</tr> 


controllers/Blog.php

PHP Code:
<?php


class Blog extends CI_Controller {

 
       public function index()
 
       {
            
                
$this->load->helper('form'); 
            
                
//$this->load->helper(array('form', 'url'));
 
               $this->load->library('form_validation');

                
 
               $this->load->model('blog_model');

 
               $data['title'] = $this->blog_model->select_blog();
                
$data['content'] = $this->blog_model->select_blog();
                
$data['date'] = $this->blog_model->select_blog();
                
                
$this->load->view('blog'$data);
                                            
                
//$this->load->view('blog');
 
       
        
}
        
        public function 
blog_form()
        {
                
$this->load->view('blog_form');
                                
        }
}



?>
" If I looks more intelligence please increase my reputation."
Reply

#4
Yes? That is part of CI 3.x, and it is not deprecated.
Is that what you are wondering?
Reply

#5
Ok thanks. Just one problem. I get this list of errors:

BLOG FORM
Date :
A PHP Error was encountered

Severity: Notice

Message: Undefined property: CI_Loader::$calendar

Filename: views/blog_form.php

Line Number: 23

Backtrace:

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\blog\application\views\blog_form.php
Line: 23
Function: _error_handler

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\blog\application\controllers\Blog.php
Line: 30
Function: view

File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\blog\index.php
Line: 315
Function: require_once

Fatal error: Call to a member function generate() on null in C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\blog\application\views\blog_form.php on line 23
A PHP Error was encountered

Severity: Error

Message: Call to a member function generate() on null

Filename: views/blog_form.php

Line Number: 23

Backtrace:
" If I looks more intelligence please increase my reputation."
Reply

#6
Try moving these into your controller:

PHP Code:
<?php $this->load->helper('form'); ?> 
<?php $this->load->library('calendar');  ?>

Calling the loader from your view is likely to cause some issues in many circumstances, so it's best to avoid doing so. The documentation of the calendar library specifically states (emphasis mine):

Quote:Like most other classes in CodeIgniter, the Calendar class is initialized in your controller using the $this->load->library function
Reply

#7
BLOG FORM

Date :
A PHP Error was encountered
Severity: Notice
Message: Undefined property: CI_Loader::$calendar
Filename: views/blog_form.php
Line Number: 23
Backtrace:
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\blog\application\views\blog_form.php
Line: 23
Function: _error_handler
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\blog\application\controllers\Blog.php
Line: 30
Function: view
File: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\blog\index.php
Line: 315
Function: require_once

Fatal error: Call to a member function generate() on null in C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\blog\application\views\blog_form.php on line 23
A PHP Error was encountered
Severity: Error
Message: Call to a member function generate() on null
Filename: views/blog_form.php
Line Number: 23
Backtrace:




Controllers/Blog.php


PHP Code:
<?php


class Blog extends CI_Controller {

 
       public function index()
 
       {
            
                <?
php $this->load->helper('form'); ?> 
                <?php $this->load->library('calendar');  ?>
            
                //$this->load->helper(array('form', 'url'));
                $this->load->library('form_validation');

                
                $this->load->model('blog_model');

                $data['title'] = $this->blog_model->select_blog();
                $data['content'] = $this->blog_model->select_blog();
                $data['date'] = $this->blog_model->select_blog();
                
                $this->load->view('blog', $data);
                                            
                //$this->load->view('blog');
        
        }
        
        public function blog_form()
        {
                $this->load->view('blog_form');
                                
        }
}



?>




views/blog.php

PHP Code:
<html>

<
title>Blog</title>

<
br>

<
h1>BLOG</h1>


<?
php $this->load->helper('date'); ?>

<?php $blogs $this->blog_model->select_blog();  ?>

<?php foreach ($blogs as $row) : ?>

    <i><?php echo $row->date?></i><br><br>
    <b><?php echo $row->title?></b><br><br>
    <?php echo $row->content?><br><br><br>
    
<?php endforeach; ?>


</html> 

I already place those 2 helper in controllers:

PHP Code:
<?php $this->load->helper('form'); ?> 
 <?php $this->load->library('calendar');  ?>

and still have the above error message.
" If I looks more intelligence please increase my reputation."
Reply

#8
They're not in the right place in your controller (the index() method is not called when displaying the view you're getting the error message on), and you need to remove the surrounding PHP tags from the method calls when you put them in the controller (since the opening PHP tag is at the top of the controller).

You have a lot of questions posted in the forum regarding the same form. You can't solve the issues independently, and changes you make in solving one issue can make other issues appear or disappear. It's also fairly obvious that you need to go through the overview and tutorial sections in the manual (or go back through it, if you have already).
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.