Getting date URLs and prev/next links working in Codeigniter [message #177688] |
Fri, 13 April 2012 15:08 |
deuteros
Messages: 2 Registered: April 2012
Karma: 0
|
Junior Member |
|
|
I can get the prev/next links working and I can get make every date a
clickable URL, but I can't seem to get both working at the same time. Can
anyone help?
function generateCalendar()
{
$date = (!isset($_GET['month']) && !isset($_GET['year'])) ? time() : strtotime($_GET['month'] . '/1/' . $_GET['year']);
$day = date('d', $date);
$month = date('m', $date);
$year = date('Y', $date);
$this->load->helper('url');
//$template['template'] = '{cal_cell_no_content}<div class="day_num"><a href="/'.$year.'/'.$month.'/{day}">{day}</a></div>{/cal_cell_no_content}';
$this->conf['template'] = '{cal_cell_no_content}<div class="day_num"><a href="/'.$year.'/'.$month.'/{day}">{day}</a></div>{/cal_cell_no_content}';
$prefs = array
(
'show_next_prev' => TRUE,
'next_prev_url' => '/CodeIgniter/index.php/CalendarTest/generateCalendar'
);
//$this->load->library('calendar', $template);
$this->load->library('calendar', $prefs);
echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4));
}
|
|
|
Re: Getting date URLs and prev/next links working in Codeigniter [message #177689 is a reply to message #177688] |
Fri, 13 April 2012 15:36 |
Captain Paralytic
Messages: 204 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On Apr 13, 4:08 pm, deuteros <deute...@xrs.net> wrote:
> I can get the prev/next links working and I can get make every date a
> clickable URL, but I can't seem to get both working at the same time. Can
> anyone help?
>
> function generateCalendar()
> {
> $date = (!isset($_GET['month']) && !isset($_GET['year'])) ? time() : strtotime($_GET['month'] . '/1/' . $_GET['year']);
>
> $day = date('d', $date);
> $month = date('m', $date);
> $year = date('Y', $date);
>
> $this->load->helper('url');
>
> //$template['template'] = '{cal_cell_no_content}<div class="day_num"><a href="/'.$year.'/'.$month.'/{day}">{day}</a></div>{/cal_cell_no_content}';
> $this->conf['template'] = '{cal_cell_no_content}<div class="day_num"><a href="/'.$year.'/'.$month.'/{day}">{day}</a></div>{/cal_cell_no_content}';
>
> $prefs = array
> (
> 'show_next_prev' => TRUE,
> 'next_prev_url' => '/CodeIgniter/index.php/CalendarTest/generateCalendar'
> );
> //$this->load->library('calendar', $template);
> $this->load->library('calendar', $prefs);
> echo $this->calendar->generate($this->uri->segment(3), $this->uri->segment(4));
> }
Better luck to be found here:
http://codeigniter.com/forums/
|
|
|
|
|
|
|
Re: Getting date URLs and prev/next links working in Codeigniter [message #177705 is a reply to message #177699] |
Sun, 15 April 2012 22:13 |
M. Strobel
Messages: 386 Registered: December 2011
Karma: 0
|
Senior Member |
|
|
Am 15.04.2012 14:52, schrieb Jerry Stuckle:
> On 4/15/2012 5:59 AM, Thomas 'PointedEars' Lahn wrote:
>> deuteros wrote:
>>
>>> I can get the prev/next links working and I can get make every date a
>>> clickable URL, but I can't seem to get both working at the same time. Can
>>> anyone help?
>>
>> Yes.
>>
>>> [uncommented code]
>>
>> <http://www.catb.org/~esr/faqs/smart-questions.html>
>>
>>
>> PointedEars
>
> Trolling again, Pointed Head? Obviously you can't help. But you have to show your
> ignorance anyway.
>
Many people here are avid to help. But so far the OP has not even shown this is a PHP
question.
/Str.
|
|
|