This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Template not rendering

Discussion relating to version 1.2.x stable

Template not rendering

by rickl2778 » Wed Aug 21, 2013 1:50 am

Hello

I am making some changes to a large Symfony 1.2 application and have run into a problem with a template not rendering and I can not understand why. Most of my MVC experience is with cakePHP so I may just be missing something but i can't see what.

I have a table that displays a number of students. I have added a column that contains a password reset link. The code for the reset link is as follows

Code: Select all
<?php echo link_to_remote('[reset password]', array('url'=>'teacher/passwordResetStudent?id='.$ticket->getUserId(),'confirm'=>'Are you sure you want to reset the password of student with username '.$ticket->getUser()->getUsername()))?>


In the teacher actions I have actions.class.php and I have added the following just to see if I can get a template to display when the rest password link is clicked before I add the logic.

Code: Select all
public function executePasswordResetStudent()
{
    $user = UserPeer::retrieveByPK($this->getRequestParameter('id');
    if(is_object($user))
    {
        // Logic to rest password will go in here based on the id returned above
    }
}


I have created a template, in teacher/templates, called passwordResetStudentSuccess.php

Code: Select all
<?php use_helper('Object', Javascript', 'Block'); ?>
<?php include_partial("homepage/pageTitle", array("image"=>"course_icon.jpg", "title"=>"Students Password Reset")); ?>

<h1>Student Password Reset</h1>


When I click on the reset password link I get the confirmation popup and when I click on the OK I see no change to the page with the table. I would have thought I would see the new passwordResetStudent template.

When I look in the log I see

Aug 21 09:42:59 symfony [info] {sfPatternRouting} Connect sfRoute "sw_toolbox_retrieve_dynamic_values" (/sw-toolbox/dynamic-values/*)
Aug 21 09:42:59 symfony [info] {sfPatternRouting} Match route "default" (/:module/:action/*) for /teacher/passwordResetStudent/id/9078 with parameters array ( 'id' => '9078', 'module' => 'teacher', 'action' => 'passwordResetStudent',)
Aug 21 09:42:59 symfony [info] {teacherActions} Call "teacherActions->executePasswordResetStudent()"
Aug 21 09:42:59 symfony [info] {sfPHPView} Render "/var/www/html/thiswayup/apps/schools/modules/teacher/templates/passwordResetStudentSuccess.php"
Aug 21 09:42:59 symfony [info] {sfPartialView} Render "/var/www/html/thiswayup/apps/schools/modules/homepage/templates/_pageTitle.php"
Aug 21 09:42:59 symfony [info] {sfWebResponse} Send status "HTTP/1.1 200 OK"
Aug 21 09:42:59 symfony [info] {sfWebResponse} Send header "Content-Type: text/html; charset=utf-8"
Aug 21 09:42:59 symfony [info] {sfWebDebugLogger} Configuration 8.36 ms (10)
Aug 21 09:42:59 symfony [info] {sfWebDebugLogger} Action "teacher/passwordResetStudent" 14.46 ms (1)
Aug 21 09:42:59 symfony [info] {sfWebDebugLogger} View "Success" for "teacher/passwordResetStudent" 13.22 ms (1)
Aug 21 09:42:59 symfony [info] {sfWebDebugLogger} Partial "homepage/_pageTitle" 1.04 ms (1)
Aug 21 09:42:59 symfony [info] {sfWebResponse} Send content (225 o)


It appears from the log that I am getting to the passwordResetStudent Action OK and the view passwordResetStudent is being called OK. It appears the partial is being included OK. The last line "Send content" suggests that the content should be sent to the browser. But it is not. I am still seeing the initial page with the table that had the reset password links.

Can anyone offer me any clues as to what I might be doing wrong or why I am not seeing my template rendered when the link is clicked.

Regards

Richard
rickl2778
Junior Member
 
Posts: 1
Joined: Wed Aug 21, 2013 1:21 am