CakePHP is a nice way of using MVC architecture in you PHP environment. Looking through this presentation you'll get introduced to MVC and get some start up code examples for you to explore.
CakePHP is a nice way of using MVC architecture in you PHP environment. Looking through this presentation you'll get introduced to MVC and get some start up code examples for you to explore.
A talk given to the New York CakePHP usergroup, discussing the specifics of changes within the CakePHP 2.0 feature set, motivations for those changes, and upcoming changes as development continues.
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Edureka!
** Python Certification Training: https://www.edureka.co/python **
This Edureka Python Flask tutorial will cover all the fundamentals of Flask. It will also explain how you can develop your own website using Flask in Python.
Introduction to Flask
Installing Flask
Flask Application
Routing in Flask
Variable Rules in Flask
URL Binding in Flask
HTTP Methods using Flask
Templates in Flask
Static Files in Flask
Request Objects in Flask
Cookies in Flask
Redirects and Errors in Flask
Flask Extensions
Conclusion
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
This is the slides I used when I shared my humble insight on Django to the students in University of Taipei in 2016. Please feel free to correct me if there is anything wrong.
A talk given to the New York CakePHP usergroup, discussing the specifics of changes within the CakePHP 2.0 feature set, motivations for those changes, and upcoming changes as development continues.
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Edureka!
** Python Certification Training: https://www.edureka.co/python **
This Edureka Python Flask tutorial will cover all the fundamentals of Flask. It will also explain how you can develop your own website using Flask in Python.
Introduction to Flask
Installing Flask
Flask Application
Routing in Flask
Variable Rules in Flask
URL Binding in Flask
HTTP Methods using Flask
Templates in Flask
Static Files in Flask
Request Objects in Flask
Cookies in Flask
Redirects and Errors in Flask
Flask Extensions
Conclusion
Follow us to never miss an update in the future.
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
This is the slides I used when I shared my humble insight on Django to the students in University of Taipei in 2016. Please feel free to correct me if there is anything wrong.
Everyone wants to jump into HTML5 but how do you use the cool features of this new specification while ensuring older browsers render your web pages as expected? This is where Modernizr, polyfills and shims come in. In the session, you’ll learn the best practices and strategy to deal with new HTML5 and CSS3 features in old legacy browsers. You’ll learn step by step how to use specially crafted JavaScript and CSS code that emulate HTML5 features. With a couple of simple changes to your sites, you can take advantage of HTML5 today without breaking your sites in older browsers. Expect a lot of demos and code in the session.
Presentation for azPHP on setting up a new project using Zend_Tool. Also goes over creating basic modules, controllers, actions, models and layouts.
All code in the presentation has not necessarily been tested. Will update presentation when done.
Learn the best practices and advanced techniques.
* Passing data to client libs, use the data attribute
* Expression contexts, choose wisely
* Use statement best practices, what fits best your needs
* Template & Call statements advanced usage
* Parameters for sub-resources, featuring resource attributes and synthetic resources
Dù bạn là ai, dù mục đích học tiếng Anh của bạn đơn thuần chỉ là có tấm bằng trong tay để xin việc hay cao siêu hơn là có thể nói thông viết thạo thì việc nằm lòng các ngữ pháp tiếng Anh ẩn chứa sức mạnh ghê gớm dưới đây cũng là bước cơ bản giúp bạn master tiếng Anh
Scalability and optimization are constant
concerns for the developer and operations
manager. The Performance Zone focuses on
all things performance, covering everything
from database optimization to garbage
collection, tool and technique comparisons,
and tweaks to keep your code as effcient
as possible.
Google công bố thông tin lịch xu hướng ngành 2017 mastercode.vnMasterCode.vn
Các doanh nghiệp cần luôn có mặt trên online để khách hàng dễ dàng thấy họ mỗi khi tìm kiếm. "Mùa vụ" hay giai đoạn mà lượng
tìm kiếm về sản phẩm dịch vụ của doanh nghiệp trên Google bỗng gia tăng chính là thời điểm tuyệt vời để tận dụng.Các doanh nghiệp
có thể tối đa hoá doanh thu trong thời kì cao điểm này bằng cách lên chiến lược quảng cáo "luôn online" gắn liền với mục tiêu mùa.
Lập trình sáng tạo creative computing textbook mastercode.vnMasterCode.vn
Lập trình sáng tạo bao gồm việc sáng tạo. Khoa học máy tính và các ngành liên quan tới tính toán đã từ lâu đƣợc giới thiệu tới những ngƣời trẻ tuổi một cách rời rạc – quá nhấn mạnh kĩ thuật so với khả năng sáng tạo. Lập trình sáng tạo giúp cho sự phát triển của cá nhân đối với tính toán trở nên tốt hơn, bằng cách hỗ trợ vẽ vời dựa trên sáng tạo, tƣởng tƣợng, và sở thích.
Pd fbuoi2 onpage – tối ưu hóa trang web-mastercode.vnMasterCode.vn
Meta Tag là thẻ dùng để cung cấp các thông tin về website một cách tóm gọn đối với các trình duyệt lẫn người dùng hay bot từ các search engine. Mọi người hay nghe Meta Keyword, Meta Description, Meta Page title,..
Pd fbuoi1 giới thiệu seo tools cơ bản-seo manager + seo guy-mastercode.vnMasterCode.vn
Google Webmaster Tools • Google Analytics phân tích traffic • SEO Power Suite , web auditor đ onpage • Ahrefs, phân tích t khóa và Link • OpenSiteExplorer phân tích link profile • Firexfox Extensions: SEO Doctor cho onpage, NoDofollow • SEOMoz Toolbar đ check PA và DA •Free Monitor for Google đ check RANK •SEOMOZ pro check onpage
Pdf buoi1 2-on-page-tran-ngoc-chinh-mastercode.vnMasterCode.vn
Cơ chế hoạt động Google Tên miền Cấu trúc website Meta Tag (Title, Description, H1-H6, ALT...) URL thân thiện, Sitemap, robots.txt Keyword Density Tốc độ tải trang
Pdfbài 7 máy tính xác tay và máy in bảo trì sự cố máy tính-mastercode.vnMasterCode.vn
Những chú ý đặc biệt khi hỗ trợ người dùng máy tính xách tay Cài đặt, cấu hình, tối ưu, sửa chữa các thiết bị ngoại vi hay dùng với máy tính xách tay Nâng cấp, thay thế các thiết bị máy tính xách tay Nguyên lý hoạt động của máy in Cài đặt máy in
Pdfbài 6 bảo trì máy tính bảo trì sự cố máy tính-mastercode.vnMasterCode.vn
Tìm hiểu các quy trình xử lý đảm bảo an toàn Tìm hiểu phương pháp bảo trì phòng ngừa cho máy tính cá nhân Tìm hiểu cách phát hiện và xử lý sự cố máy tính
Pdfbài 5 bảo trì và tối ưu windows bảo trì sự cố máy tính-mastercode.vnMasterCode.vn
Đưa ra kế hoạch bảo trì phòng ngừa Rà soát các thiết lập Windows trọng yếu Làm sạch ổ cứng Chống phân mảnh ổ đĩa Kiểm tra lỗi ổ cứng Rà soát các chương trình khởi động và dịch vụ Tiến hành các thủ tục sao lưu Lập kế hoạch khắc phục thảm họa Sao lưu dữ liệu người dùng / toàn bộ ổ cứng Tối ưu Windows Các công cụ tối ưu: Task Manager, MSConfig, Services Console, Computer Management Cải thiện hiệu năng Windows Đưa ra kế hoạch bảo trì phòng ngừa Rà soát các thiết lập Windows trọng yếu Làm sạch ổ cứng Chống phân mảnh ổ đĩa Kiểm tra lỗi ổ cứng Rà soát các chương trình khởi động và dịch vụ Tiến hành các thủ tục sao lưu Lập kế hoạch khắc phục thảm họa Sao lưu dữ liệu người dùng / toàn bộ ổ cứng Tối ưu Windows Các công cụ tối ưu: Task Manager, MSConfig, Services Console, Computer Management Cải thiện hiệu năng Windows
Pdfbài 4 ổ cứng hard drive bảo trì sự cố máy tính-mastercode.vnMasterCode.vn
Biết được các công nghệ chế tạo ổ cứng Hiểu được cấu tạo ổ cứng Phân biệt rõ các chuẩn giao tiếp giữa hệ thống với ổ cứng Thông hiểu cách tổ chức lưu trữ dữ liệu trong ổ cứng Giải quyết các vấn đề liên quan đến ổ cứng Biết được các công nghệ chế tạo ổ cứng Hiểu được cấu tạo ổ cứng Phân biệt rõ các chuẩn giao tiếp giữa hệ thống với ổ cứng Thông hiểu cách tổ chức lưu trữ dữ liệu trong ổ cứng Giải quyết các vấn đề liên quan đến ổ cứng
Pdfbài 3 cpu và ram bảo trì sự cố máy tính-mastercode.vnMasterCode.vn
Nhận biết được đặc điểm và thông số kỹ thuật của các CPU dùng cho máy tính cá nhân Thông hiểu cách lựa chọn CPU cho hệ thống Thông hiểu cách lắp mới và thay thế CPU Thông hiểu các phương pháp tản nhiệt cho CPU Thông hiểu các loại RAM khác nhau và nguyên lý hoạt động của chúng. Thông hiểu các vấn đề cần thiết khi nâng cấp RAM
Pdfbài 1 giới thiệu chung về phần cứng bảo trì sự cố máy tính-mastercode.vnMasterCode.vn
Nhắc lại các khái niệm cơ bản về phần cứng và phần mềm. Giới thiệu về các thành phần của máy tính. Nắm được vị trí sắp xếp của các thành phần bên trong case, các loại case khác nhau. Nắm được các thông số về nguồn điện được sử dụng để vận hành hệ thống máy tính. Ước lượng công suất của hệ thống và chọn bộ cấp nguồn và thiết bị lưu điện cho phù hợp. Nhận biết và xử lý một số vấn đề thường gặp liên quan đến nguồn điện
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
2. Views
Presentation Layer
Display the desired output from the request to the user.
Usually in HTML
Can also be…
XML
JSON
RSS
Files and Streaming Files
CakePHP Template Files
Written in plain PHP
.ctp ending
CakePHP supports other templating languages such as Smarty or Twig
3. Parts of the View Layer
View Layer Consists of 4 Parts
layouts
views
Displays a unique response based on the action being run
elements
The main layout for the website
Reusable code rendered inside of a view
helpers
Provides view logic and helps build code for forms, pagination, etc.
4. Layout
Presentation Layer
Does not include the views
Layout
Contents
Layout file contains the actual
<html>,<head>, and <body> tags.
Wraps around your views
Location
/app/View/Layouts/
Default Layout
default.ctp
/app/View/Layouts/default.ctp
Creating New Layout
home.ctp
/app/View/Layouts/home.ctp
View
5. Rendered View
‘content’ Block
Example
$this->fetch(‘content’);
Contains the rendered views
Layout
index.ctp
view.ctp
View
$this->fetch(‘content’);
Location?
This ‘content’ block can be placed anywhere in the Layout
Typically in the main section of your layout
6. Page Title
Individual Page Title
The layout <title> tag can be set on any page.
Using a specific a variable in the action of a controller or on the view
template itself
Variable Name
title_for_layout
Example
$this->set(‘title_for_layout’, ‘Our List of Delicious Cakes’);
7. CSS and Images
CSS and Images
Styles and images can be added to the site
Located:
/app/webroot/css – CSS Folder
/app/webroot/img – Image Folder
Linking CSS
Example
$this->Html->css(‘nameOfStyleSheet’);
No need to add the .css
Called in the layout template or the view template.
The view template call has a couple more parameters and we will cover that later
in this module.
Displaying images
Example
$this->Html->image(‘nameOfImage.jpg’)
Used in any view template or layout
This will be covered in more depth later in this module
8. Multiple Layouts
Different Layouts
Sometimes you need different layouts for different occasions
Sign up form, promotional, blog template
Layout Choice
Can be set in the controller or the view template file
Example
$this->layout = ‘promotional’;
$this->layout = ‘default’;
9. Views
Display Specific Content
Specific content for a specific page
We created a few in our catalog site
Location
/app/Views/ControllerName/view_name.ctp
View names are based on the controller action
Override the default view by using
$this->render(‘view_name’);
10. Extending Views
Extending Views
Common views can be extended for use with detailed views
Located in the app/Views directory inside the Common folder
Detailed views are the regular views associated with the controller actions
app/Views/Common/view.ctp
Example of Common View
Same header layout for all of the page views, the only difference is the title
Example
$this->fetch(‘content’) – mandatory for all common views
$this->fetch(‘title’);
Detailed View
Extend the common view
Assign the title
Example
$this->extend(‘/Common/view’);
$this->assign(‘title’, ‘New Title Name’);
12. Extending CSS
Specific Page/View CSS
The layout contains a fetch call for CSS.
$this->fetch(‘css’);
Normally in a view template you would “assign” the css
Different Call
This changed in version 2.4
$this->Html->css(‘cssFile', null, array('inline' => false));
13. Elements
Think Reusability
Bits of Code
Available on different pages
Different locations
Examples:
Sub Navigation, Quote Box, Ads
Location
app/View/Elements/
Template file (.ctp - just like all other view templates)
14. Using Elements
In Your View
Call the element method and pass as the parameter your element
view name
Example
echo $this->element(‘quote_box’);
Passing Variables into an Element
A second parameter can be passed into the element method
Associated array
key = the name of the variable
value = variable content
Example
echo $this->element(‘quote_box’, array(‘quote’ => ‘CakePHP is awesome!’);
echo $quote;
15. Helpers
What Are Helpers?
“Helpers are component-like classes for the presentation layer of [our]
application” – CakePHP Site
They help create “well-formed markup”
Basically they produce nuggets of code that we constantly use.
Include in Controller
All helpers need to be included in the Controller.
Set the variable $helpers in either the current controller or the AppController
Example
public $helpers = array(‘Form’, ‘Html’)
16. Helpers
Use
We have used some of these Helpers throughout our Catalog site.
CakePHP has a number of Helpers, here is a list of them with the parameter
value:
CacheHelper (Cache)
FormHelper (Form)
HtmlHelper (Html)
JsHelper (Js)
NumberHelper (Number)
Paginator – special scenario
RSS (Rss)
SessionHelper (Session)
TextHelper (Text)
TimeHelper (Time)
17. Helpers
Use
We have used some of these Helpers throughout our Catalog site.
CakePHP has a number of Helpers, here is a list of them with the parameter
value:
CacheHelper (Cache)
FormHelper (Form)
HtmlHelper (Html)
JsHelper (Js)
NumberHelper (Number)
Paginator – special scenario
RSS (Rss)
SessionHelper (Session)
TextHelper (Text)
TimeHelper (Time)
18. HtmlHelper
Basic Function of the HtmlHelper
The HtmlHelper generates code that is “well-formated” and used often.
Helps with tags we often forget the syntax to
For Example: Style sheets - We know it’s a link tag, but does the link tag take a
“href” for the source file or a “src”?
Lots of Methods
The HtmlHelper has a lot of helpful methods, but we are only going to cover
the following:
css
image
script
We will cover the basics of each
Link to HtmlHelpers
http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html
19. HtmlHelper - CSS
Updated
Method has changed in version 2.4
This will not work with the current version of CakePHP we are working with.
If you have version 2.3 installed please refer to the segment on Views earlier in
this module.
Information below is for the 2.4 version.
Takes One or Two Parameters
Focus only on the first parameter, second is optional
First Paramenter
CSS file name or an array of CSS file names
Example
This is relative to the app/webroot/css folder
echo $this->Html->css(‘styleSheet’); // .css file extention not needed
echo $this->Html->css(array(‘menus’, ‘layout’)); // .css file extention not needed
Output
<link rel=“stylesheet” type=“text/css” href=“/css/menus.css” />
<link rel=“stylesheet” type=“text/css” href=“/css/layout.css” />
20. HtmlHelper - Image
Parameters
First – string path to the image
This is relative to the app/webroot/img folder
Second – optional associated array of options (html attributes)
Example
echo $this->Html->image(‘chocCake.jpg’, array(‘alt’ => ‘Chocolate Cake’);
Output
<img src=“/img/chocCake.jpg” alt=“Chocolate Cake” />
21. HtmlHelper - Script
Similar to the CSS Method
Parameters
First – String to a single JS file, or an array of JS files.
This is relative to the app/webroot/js folder
Will also allow for directories outside webroot/js folder
Can also take a path to a remote URL
Second – optional associated array of options (html attributes)
We will only focus on the first parameter
Example
echo $this->Html->script(“scripts”);
echo $this->Html->script(“/newJSDirectory/scripts”);
echo $this->Html->script(“http://www.somesites.com/jsFile.js”);
Notice you must include the extention
Output
<script type=“text/javascript” src=“/js/scripts.js”></script>
22. FormHelper
Basic Function of the FormHelper
The FormHelper generates the needed code for form creation
Creates forms quickly
Streamlines validation, re-population and layout.
Lots of Methods
The FormHelper has a lot of methods. We will be covering the following:
create
end
hidden
password
input
We will cover the general basics of each of them
Link to FormHelper
http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html
23. FormHelper - Create
Parameters
First – optional string model name
Second – optional associated array of options
Defaults
Form method defaults to ‘post’
Example
General Add or Edit form with Model
echo $this->Form->create(“Items”);
Output
<form id=“ItemAddForm” method=“post” action=“/items/add”>
If Edit form
<form id=“ItemEditForm” method=“post” action=“/items/edit/5”>
<input type=“hidden” name=“_method” value=“PUT” />
24. FormHelper - End
Single Parameter Optional
String name for submit button or
Associated array of options
Example
echo $this->Form->end();
echo $this->Form->end(“Add Item”);
Output
</form>
<div class=“submit”>
<input type=“submit” value=“Add Item” />
</div>
</form>
25. FormHelper - Hidden
Parameters
First - string field name
Second – optional associated array of options
Example
echo $this->Form->hidden(“id”);
Output
<input name=“data[Item][id]” value=“16” id=“ItemId” type=“hidden” />
26. FormHelper - Password
Parameters
First - string field name
Second – optional associated array of options
Example
echo $this->Form->password(“password”);
Output
<input name=“data[User][password]” value=“” id=“UserPassword”
type=“password” />
27. FormHelper - Input
Parameters
First – string field name
Second – optional associated array of options
Basic Understanding
Output of an input method
div container
label tag
input tag
error element (if applicable)
28. FormHelper - Input
Basic Understanding Cont’d
The input method determines what type of input you need based on the
field that is provided (first parameter).
Below is a list of associations based on column type
Column Type
Form Field
string (char, varchar, etc.)
text
boolean, tinyint(1)
checkbox
text
textarea
text (field name of password, passwd, psword)
password
text (field name of email)
email
text (field name of tel, telephone, phone)
tel
date
day, month, and year selects
datetime
day, month, year, hour, minute, and
meridian selects
time
hour, minute, and meridian selects
29. FormHelper - Input
Input Options
Optional
Associated array, key/value pairs
Below is a list of a few different types of options available. The full list can be
found here
http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#options
Options List
Type – Force the type of input to be used
Label – provide personal text for the label tag
Example – ‘default’ => ‘Chocolate Cake’
Selected – set a selected option based on the value provided
Example – ‘label’ => ‘First Name’
Default – set the default value of the field
Example - ‘type’ => ‘email’
Example – ‘selected’ => ‘3’
Rows, Cols – set the rows and columns of a text area
Example – ‘rows’ => ‘5’, ‘cols’ => ‘10’