PHPのような出力があります。私はUsername
を表示したいが、動作させることはできない。一重引用符でPHPコードを呼び出す
Thank You Elaine Byrne for your submission
:どのように私は$formLayout
ユーザーネームを呼び出す必要がありますので、何か読み
// Define the maximum number of submissions.
$max = 1;
// Get the current logged in user.
$user = JFactory::getUser();
// Get a database connection.
$db = JFactory::getDbo();
$query = $db->getQuery(true);
// Setup the query.
$query->select('COUNT('.$db->qn('Username').')')
->from($db->qn('#__rsform_submissions'))
->where($db->qn('FormId').'='.$db->q($formId))
->where($db->qn('Username').'='.$db->q($user->get('username')));
// You can also count by User ID, just replace the above with:
// ->where($db->qn('UserId').'='.$db->q($user->get('id')));
$db->setQuery($query);
$counter = $db->loadResult();
if ($counter >= $max){
$formLayout = 'Thank You Username for your submission';
}
http://php.net/manual/en/language.types.string.php – AbraCadaver