Download the PHP package sledgehammer/mvc without Composer

On this page you can find all versions of the php package sledgehammer/mvc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mvc

Sledgehammer MVC

MVC aka Model View Controller

Model

These are the classes you'll write yourself. If your looking for database persistance for your models check out the Sledgehammer ORM module.

View

The "View" is a composition of components.

Every component has a "render" function which sends the output directly to the browser (echo) and doesn't have a return value.

Component->getHeaders()

A Component has an optional getHeaders() function, which is called before render() and passes info to the components higher in the component hierarchy. This can add "HTTP headers", append stylesheets and other configuration that must be injected into the <head>

'http' Dit is een array die met de header() verstuurd zullen worden. 'meta' Dit is een array die als tag(s) in de wordt toegevoegd 'css' Dit is een array met urls die als als in de wordt toegevoegd 'link' Dit is een array die als tag(s) in de wordt toegevoegd 'title' Dit is de die in de <head> wordt gezet.</p> <h3>Controller</h3> <p>Sledgehammer doesn't have a Routing class, all requests are handled by a subclass of Folder classes.</p> <h3>Mapping examples:</h3> <p>The "/about.html" url is mapped to MyWebsite->about(). If no public <em>about</em> method is found the file() method is called. By default the file() returns an component that renders a 404 error.</p> <p>The "/blog/author.html" is mapped to MyWebsite->blog_folder(). if no public <em>blog</em> method is found the folder() method is called.</p> <p>The blog_folder() could direclty return a compontent, but it could also create a Folder object which would handle all request inside the "blog/" folder. The "author.html" part of url is mapped to MyBlogFolder->author(). If no public <em>about</em> method is found the file() method is called on the MyBlogFolder.</p> <h3>Scope</h3> <h4>Website</h4> <p>Het volledig afhandelen van request.</p> <p>Versturen naar browser Opslaan op schijf</p> <h4>HtmlDocument</h4> <p>De waardes van getHeaders() verwerken in de doctype template.</p> <h3>Installation</h3> <p>Place the mvc folder in the same folder as Sledgehammer's core folder.</p> <p>To generate a scaffolding for an MVC project, run</p> <h3>Twitter Bootstrap</h3> <p>Contrains all the css & javascript from: <a target="_blank" href="http://twitter.github.com/bootstrap/">http://twitter.github.com/bootstrap/</a> and adds Sledgehammer\View classes.</p> <p>Becomes:</p></div><hr/> <h2 id="all-versions">All versions of mvc with dependencies</h2> <div id="select-php-version" class="input-group" title="PHP version which will be used to build the Composer package."> <span class="input-group-addon">PHP Build Version</span> <select name="phpVersion" autocomplete="off" class="custom-select form-control"> <option value='8.0.21'>8.0.21</option><option value='7.3.33'>7.3.33</option> </select> </div> <div id="select-package-version" class="input-group" title="Which version of the package should be downloaded."> <span class="input-group-addon" id="select-package-version-label">Package Version</span> <select class="custom-select form-control" aria-describedby="select-package-version-label" autocomplete="off" data-package="mvc" data-vendor="sledgehammer" data-latest-version="18.08.0.0" > <option value="18.08.0.0" selected="selected" > 18.08.0 </option> <option value="18.04.0.0" > 18.04.0 </option> <option value="16.05.0.0" > 16.05.0 </option> <option value="13.09.0.0" > 13.09.0 </option> <option value="13.06.0.0" > 13.06.0 </option> <option value="13.02.0.0" > 13.02.0 </option> <option value="12.10.2.0" > 12.10.2 </option> <option value="12.10.1.0" > 12.10.1 </option> </select> </div> <div id="accordion" role="tablist" aria-multiselectable="true"> <div class="card"> <div class="card-header" role="tab" id="heading"> <h3 class="mb-0"> <a data-toggle="collapse" data-parent="#accordion" href="#collapse" aria-expanded='true' aria-controls="collapse"> Version 18.08.0 <span class="date">Release 27. Jul 2018</span> </a> <p class="hidden-md-up"></p> <label class="float-right">  <button class="btn btn-phplibs btn-sm difference-btn"><i class="fa fa-question-circle"></i></button> </label> <label class="radio-inline float-right">   <input type="radio" name="download_type" value="CREATE_PROJECT" > create-project</label> <label class="radio-inline float-right">   <input type="radio" name="download_type" value="REQUIRE" > require</label> <label class="float-right option-advice"> 0 people choosed <em>require</em> and<br/>0 people choosed <em>create-project</em>. </label> <div class="float-right"> <button type="button" class="btn btn-phplibs float-right add-to-project-btn" data-name="sledgehammer/mvc" data-version="18.08.0.0" data-vendor="sledgehammer"> <i class="fa fa-plus-circle"></i> Add to Project </button> <div class="clearfix" ></div> <a href rel="nofolow" data-package="mvc" data-vendor="sledgehammer" data-version="18.08.0.0" class="btn btn-phplibs float-right download-btn"><i class="fa fa-download"></i> Download </a> </div> </h3> <img class="latest-version" src="/img/latest_version.jpg" alt="Download latest version of mvc from vendor sledgehammer"> </div> <div id="collapse" class="collapse" role="tabpanel" aria-labelledby="heading"> <div class="card-block"> <strong>Requires</strong> <a href="/package/sledgehammer/core"><strong>sledgehammer/core</strong></a> Version <em>>=18</em><br/> </div> </div> </div> </div> <span onclick="ga('send', 'event', 'Client Download detail page', 'Client Download detail page')" >Composer command for our command line client (<a target="_blank" href="/php-composer-cloud-build-server">download client</a>)</span> <input type="text" class="form-control copy-to-clipboard" value="php-download require sledgehammer/mvc"> <em class="mb-2 d-block">This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free.</em> <span>Standard composer command</span> <input type="text" class="form-control copy-to-clipboard" value="composer require sledgehammer/mvc"> <p></p> <p></p><h2 id='files'>The package sledgehammer/mvc contains the following files</h2><input id='packageSearch' name='packageSearch' type='text' placeholder='Search files' class='form-control' style='display:none;' /><div class='file-wrapper'><span><i class='fa fa-spinner fa-pulse fa-2x fa-fw'></i> Loading the files please wait ....</span></div><div class='clearfix' ></div><p></p> <script> function initVersionSpecificActions() { $(".difference-btn").click(function (e) { showDialog("<em>require</em>" + "<br/>If this library should be a part of your project, then choose require. " + "It results in a zip file, which contains a vendor folder. In this vendor folder will be the library you downloaded. " + "There is a dummy index.php as a example to integrate the library." + "<br/><br/>" + "<em>create-project</em>" + "<br/>This option should be choosed, if you want to create a project at top of this code. " + "This option should be choosed if you download a PHP framework like Laravel, CakePHP, ..."); }); var downloadButton; var chosenDownloadType; var chosenPhpVersion; var loadingModal; var fileCheckInterval; var isFileCheckRequestRunning = false; $(".download-btn").click(function (e) { e.preventDefault(); downloadButton = $(e.target).closest("a"); chosenDownloadType = downloadButton.closest('.card').find("input[name^=download_type]:checked").val(); chosenPhpVersion = $("select[name='phpVersion']").val(); if (!chosenDownloadType) { showDialog("Please choose a download type require or create-project"); return; } loadingModal = $('#download-loading-dialog'); setLoadingModalContent( '<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i> Loading, please wait ...', 'Before you can download the PHP files, the dependencies should be resolved. <strong>This can take a few minutes.</strong> Please be patient.' ); loadingModal.modal('show'); checkIfFileIsReady(); fileCheckInterval = setInterval(checkIfFileIsReady, 3000); }); var checkIfFileIsReady = function () { if (isFileCheckRequestRunning) { return; } if (!apiKey) { window.location.href = "/users/register?rel=" + encodeURIComponent(window.location.href); return; } $.ajax(downloadDomain + '/api/v1/packages/start-download', { data: { version: downloadButton.data("version"), package: downloadButton.data("package"), vendor: downloadButton.data("vendor"), downloadType: chosenDownloadType, phpVersion: chosenPhpVersion }, headers: { "API-Key": apiKey }, type: 'GET', beforeSend: function () { isFileCheckRequestRunning = true; }, complete: function (xhr) { isFileCheckRequestRunning = false; var isError = true; var response = null; if (xhr.status === 200) { response = JSON.parse(xhr.responseText); if (typeof response.status === 'string') { if (response.status === 'complete' && typeof response.url === 'string') { clearFileCheckInterval(); location.href = response.url; return; } else if (response.status === 'pending') { isError = false; } } } else if (xhr.status === 403) { response = JSON.parse(xhr.responseText); switch (response.code) { case "no_subscription": window.location.href = "/billing?no_subscription=1"; break; } return; } if (isError) { clearFileCheckInterval(); setLoadingModalContent('<i class="fa fa-exclamation-triangle"></i> Internal error', 'Please try again later or <a href="mailto:jwwi2013@gmail.com">contact us</a>.', true); loadingModal.find('.close').removeClass('hidden'); setTimeout(function () { loadingModal.modal('hide'); }, 10 * 1000); } } }); }; function clearFileCheckInterval() { clearInterval(fileCheckInterval); fileCheckInterval = null; } function setLoadingModalContent(titleHtml, bodyHtml, isError) { var modalTitle = loadingModal.find('.modal-title'); var modalBody = loadingModal.find('.modal-body'); var errorClass = 'danger'; modalTitle.html(titleHtml); modalBody.html(bodyHtml); if (isError) { modalTitle.addClass(errorClass); } else { modalTitle.removeClass(errorClass); } } $(".add-to-project-btn").click(function (e) { let buttonElement = $(e.target).closest("button"); $.ajax("/project-positions/add", { data: "version=" + buttonElement.data("version") + '&name=' + buttonElement.data("name") + '&vendor=' + buttonElement.data("vendor") + '&add_type=REQUIRE', type: "POST", success: function (response) { response = JSON.parse(response); if (!response.success) { switch (response.errorCode) { case "no_active_project": showDialog("There is no active project."); break; case "already_added": showDialog("This item is already added to your project."); break; default: showDialog("There was an error. Please contact the support."); break; } } else { showSuccessToast("Item was added to the project."); } }, error: function (xhr, status) { if (xhr.status == 403) { window.location.href = "/users/register"; } else { showDialog("There was an error. Please contact the support."); } } }); }); } initVersionSpecificActions(); $(function () { $.get(downloadDomain + "/files-list/package-ajax/sledgehammer/mvc", function (data) { $(".file-wrapper").html(data); if ($('.file-entry').length) { $("#packageSearch").show(); } // toggle folder on click //TODO: code is repeated $('.dir-entry').each(function (i, e) { $(e).click(function () { $(this).next().toggle(); $(this).find('.fa').toggleClass('fa-caret-down').toggleClass('fa-caret-right'); }); }); $('.collapse-all-folders').click(function () { $('.dir-entry').each(function (i, e) { $(e).next().hide(); $(this).find('.fa').removeClass('fa-caret-down').addClass('fa-caret-right'); }); $(this).hide(); $('.expand-all-folders').show(); }); $('.expand-all-folders').click(function () { $('.dir-entry').each(function (i, e) { $(e).next().show(); $(this).find('.fa').addClass('fa-caret-down').removeClass('fa-caret-right'); }); $(this).hide(); $('.collapse-all-folders').show(); }); }); }); $(".copy-to-clipboard").focus(function () { $(this).select(); copyTextToClipboard($(this).val()); showSuccessToast("Copied to clipboard!"); ga('send', 'event', 'Copied require cmd', 'Copied require cmd'); }); $("#packageSearch").keyup(function (event) { var indentLevels = [2, 4, 6, 8, 10, 12]; var files = $('.file-entry'); var dirs = $('.dir-entry'); var expandDirs = $('.expand-all-folders'); var collapseDirs = $('.collapse-all-folders'); files.hide(); expandDirs.click().hide(); collapseDirs.hide(); var txt = $(this).val(); files.each(function () { if ($(this).text().toUpperCase().indexOf(txt.toUpperCase()) !== -1) { $(this).show(); dirs.hide(); for (var i = 0; i < indentLevels.length; i++) { if (countInstances($(this).html(), 'nbsp') === indentLevels[i]) { $(this).addClass(indentLevels[i].toString()); break; } } $(this).html($(this).html().replace(/ /g, '')); } }); if ($(this).val() == '') { //TODO: simplify $('.dir-entry').show(); $('.2').prepend('  '); $('.4').prepend('    '); $('.6').prepend('      '); $('.8').prepend('        '); $('.10').prepend('          '); $('.12').prepend('            '); } if ($(this).val() === '') { dirs.show(); expandDirs.hide(); collapseDirs.show().click(); for (var i = 0; i < indentLevels.length; i++) { $('.' + indentLevels[i].toString()).prepend(' '.repeat(indentLevels[i])); } } }); function countInstances(string, word) { return string.split(word).length - 1; } $("#select-package-version select").change(function () { const select = $(this); const version = select.val(); $.get( '/details/version/' + select.data('vendor') + '/' + select.data('package') + '/' + version, function (data) { if (typeof data === 'string' && data.length > 0) { $("#accordion").html(data); initVersionSpecificActions(); var latestVersionImage = $('img.latest-version'); if (version !== select.data('latest-version')) { latestVersionImage.hide(); } else { latestVersionImage.show(); } } } ); }); </script> </main> <footer> <p></p> <div class="text-center">© 2017 - 2024 Weber Informatics LLC</div> </footer> <!-- ************************** DIALOGS ************************** --> <div class="modal" id="download-loading-dialog" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" data-keyboard="false"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="exampleModalLabel"><i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i> Loading please wait ...</h5> <button type="button" class="close hidden" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> Before you can download the PHP files, the dependencies should be resolved. <strong>This can take some minutes.</strong> Please be patient. </div> </div> </div> </div> <div class="modal fade" id="general-dialog" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" data-keyboard="false"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-body"> CONTENT </div> <div class="modal-footer"> <button type="button" data-dismiss="modal" class="btn btn-phplibs btn-sm">OK</button> </div> </div> </div> </div> <!-- ************************** DIALOGS ************************** --> </body> </html>